Commit Graph

47 Commits

Author SHA1 Message Date
Jannik Clausen
c41d223733 dialect/sql/schema: disable foreign keys before opening a transaction (#2966)
* dialect/sql/schema: disable foreign keys before opening a transaction

* dialect/sql/schema: disable foreign keys before opening a transaction

* fix tests

* add test for bug

* apply CR
2022-09-28 07:41:49 +02:00
Jannik Clausen
5b67bdab4f dialect/sql/schema: atlas engine is now default (#2698)
* atlas engine is default, enabled diff by replay

* Apply suggestions from code review

* docs

* apply CR
2022-07-05 12:29:15 +02:00
Ariel Mashraki
98d00a35b5 go: update atlas and test global-unique-id migration (#2661) 2022-06-18 21:50:44 +03:00
Thomas Prebble
ce9641e1ae dialect/sql/schema: support postgres geometric types (#2340) 2022-02-18 17:08:25 +02:00
s-takehana
0fd6143979 dialect/sql/schema: support time with time zone and time without time zone (#2257)
* dialect/sql/schema: support `time with time zone` and `time without time zone`

* fix test

* fix test
2022-01-12 14:33:26 +02:00
Mehmet Yılmaz
4d01a56b8d dialect/sql/schema: allow adding DEFAULT to columns on migration #1758 (#2199)
* add feature to SET DEFAULT value when add new default value to a existing column

* refactoring unit tests

* correct misspells

* code review refactors

* refactors

* Update dialect/sql/schema/postgres.go

* Update dialect/sql/schema/postgres.go

* Update dialect/sql/schema/postgres.go

* Update dialect/sql/schema/postgres.go

* Update dialect/sql/schema/postgres.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2021-12-20 11:29:07 +02:00
Ariel Mashraki
475e237937 dialect/sql/schema: fix bug when using multiple table CHECK constraints (#2188)
Fixed https://github.com/ent/ent/issues/2185
2021-12-01 12:00:06 +02:00
Naor Matania
8847a1ac55 dialect/sql/schema: fix migrating Postgres fields with max character varchar custom type (#2162)
* Support migration of varying length varchar postgres

* update type

* fix type

* improve type

* remove not needed change

* fix failing test

* add inspect test

* add more tests

* go fmt

* fix pr comment
2021-11-28 07:57:57 +02:00
Ariel Mashraki
14cba0abb6 dialect/sql/schema: make Field.Unique and Index.Unique equal (#2004)
This will allow moving from:

	field.String(c).Unique()

To:

	index.Field(c).Unique()

And vice versa
2021-10-03 16:20:28 +03:00
Ariel Mashraki
5c7c36bf29 dialect/sql/schema: skip parsing expression default for postgres
Fixed https://github.com/ent/ent/issues/1962
2021-09-21 15:59:04 +03:00
Ruben de Vries
1ea718f7bf dialect/sql/schema: add support for postgres and mysql numeric and decimal types in migrations (#1721)
* improve error message when failing to generate changeset

* support migrations for postgres and mysql numeric fields
2021-07-16 13:57:53 +03:00
bshihr
4066255641 dialect/sql/schema: add IndexBuilder.IfNotExists and use for Create() case. (#1666)
Append-only mode creates tables with the `IF NOT EXISTS` annotation.
Make indices case symmetric with this.
2021-06-30 09:09:48 +03:00
Ariel Mashraki
42a2c67cc4 dialect/entsql: add support for table checks in schema/migration 2021-06-17 23:22:37 +03:00
Ariel Mashraki
f7db15ccbb dialect/sql/schema: add field collation support for postgres 2021-05-10 20:32:45 +03:00
Vojtěch Káně
43ef74b8a8 entc/gen: add support for default annotation to PKs as well (#1492) 2021-04-22 14:16:53 +03:00
Ariel Mashraki
5bcee6b51c dialect/sql/schema: add postgres tests for array type 2021-04-14 14:25:28 +03:00
Ariel Mashraki
745afde770 dialect/entsql: add support for column default using annotation
Fixed #1033
2021-04-03 21:53:56 +03:00
Ariel Mashraki
dd4792f5b3 go: rename module from github.com/facebook/ent => entgo.io/ent (#1226) 2021-02-02 23:03:04 +02:00
Ariel Mashraki
91f7e3363a dialect/sql/schema: support providing alternate schema for postgres (#1172) 2021-01-14 16:55:37 +02:00
Ciaran Liedeman
7320b0d16c dialect/sql/schema: add pg user defined type for schema introspect (#994)
* Added user defined fields

* pr feedback

* added integration test

* run generate

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* Update dialect/sql/schema/postgres_test.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2020-12-27 20:00:47 +02:00
Ariel Mashraki
ed4a8fe010 dialect/sql/schema: replace all unquote for postgres dialect (#1019) 2020-12-06 11:49:02 +02:00
Ariel Mashraki
3d2feec5e2 dialect/sql/schema: initial support for postgres net-types (#964) 2020-11-20 15:30:54 +02:00
Ariel Mashraki
77eaad0df6 dialect/sql/schema: skip default value parsing on pg functions (#951)
Closes #934
2020-11-15 22:55:52 +02:00
Ariel Mashraki
faa54f5e79 Merge branch 'master' of https://github.com/day-dreams/ent into day-dreams-master 2020-10-21 12:31:11 +03:00
kakaxizhang
63421aa9ad dialect/sql/schema: optimize code and add website documents (#748) 2020-10-12 16:08:02 +08:00
Ariel Mashraki
13b379d07c dialect/sql/schema: properly handle indexes of tables with uncountable name (#828) 2020-10-08 23:24:54 +03:00
day-dreams
4582ed0f2a dialect/sql/schema: use withForeighKeys() instead of withForeighKeysDisable(), and add unit tests () (#748) 2020-09-20 16:49:47 +08:00
Ariel Mashraki
1348df349f dialect/sql/schema: disable fixture in default migration (#753) 2020-09-13 11:13:02 +03:00
Ariel Mashraki
fd0a7f9f02 all: facebookincubator/ent => facebook/ent (#660)
ent repository is going to be migrated to facebook organization
2020-08-18 11:05:08 +03:00
Ariel Mashraki
16d98d1acc dialect/sql/schema: accept default values for enum fields (#646)
Fixed #644
2020-07-28 12:55:02 +03:00
Ariel Mashraki
d26fbaeb54 dialect/postgres: fix postgres naming prefix and detection for indexes (#543) 2020-06-10 22:24:16 +03:00
Ariel Mashraki
997a060043 dialect/sql/schemma: fail if column type is invalid (#486) 2020-05-11 14:20:35 +03:00
Ariel Mashraki
f384701c04 dialect/sql/schemma: ignore pgtime default value on scanning (#468) 2020-05-06 22:34:01 +03:00
Ariel Mashraki
196a764691 dialect/sql/schema: use the postgres column type if exists (#466) 2020-05-06 21:54:21 +03:00
Ariel Mashraki
51cdda421f dialect/sql/schema: add optional schema-type to column spec (#461) 2020-05-04 20:16:43 +03:00
Ariel Mashraki
6824259b80 dialect/sql/schema: remove code-duplication from pg test (#422) 2020-04-06 15:44:21 +03:00
Ariel Mashraki
b4255998bf entc/gen: change name format for edge fks (#286)
* entc/gen: change name format for edge fks

* dialect/sql/schema: add fixture support for mysql and postgres

* sql/dialect: merge fkcolumn queries to one for the 2 dialects
2020-02-03 15:41:55 +02:00
Ariel Mashraki
3425754c8e dialect/sql/schema: scan multi-column indexes with their correct position (#308) 2020-01-22 04:43:01 -05:00
Ariel Mashraki
6bb834612c dialect/sql/schema: drop unique constraint on pg migration
Fixes #235
2019-12-15 18:52:05 +02:00
Ariel Mashraki
db7b05ad04 dialect/sql/schema: postgres support for uuid type
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/178

Reviewed By: alexsn

Differential Revision: D18615561

fbshipit-source-id: 8244189186bf35d78cfdb991ee4f8cecd6411cee
2019-11-20 09:49:54 -08:00
Ariel Mashraki
d5c111b35a dialect/sql/schema: univerdal id support for postgres
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/122

Reviewed By: alexsn

Differential Revision: D18113754

fbshipit-source-id: 1050f0c2b823db6ba1bc37c36f6749cfcffa982d
2019-10-24 08:45:09 -07:00
Ariel Mashraki
7f598f34a2 dialect/sql/schema: fix constraint symbol size for postgres
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/121

Reviewed By: alexsn

Differential Revision: D18113304

fbshipit-source-id: 80d4c65323eb2613fbb9ab47754b1e70b42b1b15
2019-10-24 08:45:09 -07:00
Ariel Mashraki
88bfbc38df dialect/sql/schema: index builders per dialect
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/118

Reviewed By: alexsn

Differential Revision: D18092371

fbshipit-source-id: 02b85724b1e00d10c930112b9e2c8d07c8727216
2019-10-24 02:23:33 -07:00
Ariel Mashraki
c414cd9a82 dialect/sql/schema: alter column for postgres
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/117

Reviewed By: alexsn

Differential Revision: D18083914

fbshipit-source-id: a5f6993cfe9a260a84c0d4ab868e3e797b3a5776
2019-10-23 05:39:17 -07:00
Ariel Mashraki
a0c7ee77dc dialect/sql/schema: default value format support for postgres
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/116

Reviewed By: alexsn

Differential Revision: D18083400

fbshipit-source-id: 5939aa2d1819d991ae74adc81c4ac60455bb7ed0
2019-10-23 05:39:16 -07:00
Ariel Mashraki
2789257849 dialect/sql/schema: alter table for postgres
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/115

Reviewed By: alexsn

Differential Revision: D18065988

fbshipit-source-id: a7d33bbebd63b01659bc5ba562ac85642dcd3d83
2019-10-22 12:55:36 -07:00
Ariel Mashraki
dff3067639 dialect/sql/schema: table creation tests for postgres
Reviewed By: alexsn

Differential Revision: D18059272

fbshipit-source-id: f93785378119dfa18be31fdfc969848ea6d9b782
2019-10-22 08:17:05 -07:00