Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@a8m
Copy link
Member

@a8m a8m commented Jul 13, 2022

Fixed #2744.

Users that want to use a serial type for their id field, can create one mixed-in schema (with the definition below) and embed it in all schemas.

func (MixinID) Fields() []ent.Field {
	return []ent.Field{
		field.Int("id").
			SchemaType(map[string]string{
				dialect.Postgres: postgres.TypeBigSerial,
			}),
	}
}

@a8m a8m merged commit 1c01301 into master Jul 13, 2022
@a8m a8m deleted the pgserial branch July 13, 2022 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Question] Working with exists postgres array column with default value.

2 participants