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

adds columns list variable without default value columns #400

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions generator/metadata/table_meta_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,18 @@ func (t Table) MutableColumns() []Column {

return ret
}

// MutableNonDefaultColumns returns list of mutable non-default columns for table
func (t Table) MutableNonDefaultColumns() []Column {
var ret []Column

for _, column := range t.Columns {
if column.IsPrimaryKey || column.IsGenerated || column.HasDefault {
continue
}

ret = append(ret, column)
}

return ret
}
15 changes: 9 additions & 6 deletions generator/template/file_templates.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading