Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: unify database columns #3449

Closed
3 tasks done
zc-devs opened this issue Feb 27, 2024 · 1 comment · Fixed by #3806
Closed
3 tasks done

Refactor: unify database columns #3449

zc-devs opened this issue Feb 27, 2024 · 1 comment · Fixed by #3806
Labels
refactor delete or replace old code server

Comments

@zc-devs
Copy link
Contributor

zc-devs commented Feb 27, 2024

Clear and concise description of the problem

There are examples of entities:

type Pipeline struct {
	ID                  int64                   `json:"id"                      xorm:"pk autoincr 'pipeline_id'"`
	Status              StatusValue             `json:"status"                  xorm:"INDEX 'pipeline_status'"`
	ChangedFiles        []string                `json:"changed_files,omitempty" xorm:"LONGTEXT 'changed_files'"`
	PullRequestLabels   []string                `json:"pr_labels,omitempty"     xorm:"json 'pr_labels'"`
type Step struct {
	ID         int64       `json:"id"                   xorm:"pk autoincr 'step_id'"`
	Type       StepType    `json:"type,omitempty"       xorm:"step_type"`
	Name       string      `json:"name"                 xorm:"step_name"`
	State      StatusValue `json:"state"                xorm:"step_state"`
type LogEntry struct {
	ID      int64        `json:"id"       xorm:"pk autoincr 'id'"`
	StepID  int64        `json:"step_id"  xorm:"INDEX 'step_id'"`
	Created int64        `json:"-"        xorm:"created"`

Suggested solution

Get rid of useless prefixes like pipeline_ in pipelines table, step_ in steps table and so on. Exception is link to other entities like step_id in log_entries table.

Alternative

No response

Additional context

No response

Validations

  • Checked that the feature isn't part of the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@zc-devs zc-devs added the feature add new functionality label Feb 27, 2024
@qwerty287
Copy link
Contributor

Similar for table names: some are singular, some plural.

@qwerty287 qwerty287 added server refactor delete or replace old code and removed feature add new functionality labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor delete or replace old code server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants