Commit Graph

42 Commits

Author SHA1 Message Date
Daven
534dbbe590 dialect/entsql: add support for table-options in annotation (#938) 2020-11-10 20:40:56 +02:00
Ariel Mashraki
762df65f11 dialect/entsql: use annotation in schema builder (#929) 2020-11-08 11:26:44 +02:00
Ariel Mashraki
ae7ba0b43c dialect/sql: minor comment fixes (#687) 2020-08-23 20:48:56 +03:00
Ariel Mashraki
b18716931d dialect/sql: change boolean operators wrapping (#678)
The reason is to parentheses only when it's necessary.
2020-08-20 10:08:31 +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
3e7481c3a0 dialect/sql/schema: ignore mysql default values for type type (#561) 2020-06-21 23:16:05 +03:00
Ariel Mashraki
cfee55e514 schema/field: add an option to configure the database type (#484) 2020-05-11 15:07:33 +03:00
Alex Snast
68db86be76 avoid multiple rows.Err calls on error path
Signed-off-by: Alex Snast <alexsn@fb.com>
2020-05-11 14:26:40 +03:00
Ciaran Liedeman
f59abad425 fix: checks for error after rows.Next call (#480) 2020-05-09 16:23:47 +03:00
Ariel Mashraki
bcb579106a dialect/sql/schema: revert #463 for int type (#470) 2020-05-07 08:23:10 +03:00
Ariel Mashraki
769a2ed302 dialect/sql/schemma: return the database column type if exists (#463) 2020-05-05 19:32:52 +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
2208b243db dialect/sql/schema: initial work for incremental migration (#428)
This is a WIP PR and should be ignored this moment.
It's based on PR #221 created by Erik Hollensbe (He should
get his credit for his work before we land this).
2020-04-12 19:12:33 +03:00
Ariel Mashraki
b1eb999097 dialect/sql/schema: comment changes (#415) 2020-03-31 22:51:50 +03:00
Ariel Mashraki
ab71992b7c dialect/sql/mysql: fix verifyrange check for mysql (#337) 2020-02-09 16:09:02 +02:00
Ariel Mashraki
26440c2bc9 dialect/sql/schema: setrange on custom column name of pks (#333) 2020-02-09 09:41:26 +02:00
qystishere
374b5dd3b8 dialect/sql/schema: support mysql latest numeric type format (#328) 2020-02-08 15:37:35 +02:00
Ariel Mashraki
c0c0d2ae5c dialect/sql/schema: verify and fix mysql auto-increment on reset (#329) 2020-02-06 19:36:23 +02: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
6819c01906 dialect/sql: allow nil values for exec commands (#313)
In most cases, the sql.Result is not needed.
2020-01-22 22:43:45 +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
91c163525f dialect/sql/schema: correctly read uint32 type in migration (#289)
Fixes #287
2020-01-15 17:46:16 +02:00
Ariel Mashraki
7fc3689027 dialect/sql/schema: add prepare option to mysql dialect 2020-01-01 19:11:20 +02: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
703a6dd039 dialect/sql/schema: mysql support for uuid type
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/176

Reviewed By: alexsn

Differential Revision: D18615992

fbshipit-source-id: 2c86a661e8d75165470b9b2d351cb973147290d8
2019-11-20 09:49:55 -08:00
Ariel Mashraki
54b1a2ead9 sql/dialect/schema: accept old blob types in mysql (#164)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/164

support varbinary as blob types

Reviewed By: yhayun

Differential Revision: D18504189

fbshipit-source-id: e3c8fcf412d1f6374b0084b439eee426b24b3466
2019-11-14 06:37:17 -08:00
Ariel Mashraki
ea479ea527 dialect/sql/schema: move SQLite logic to its own file
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/129

Reviewed By: alexsn

Differential Revision: D18164329

fbshipit-source-id: 79abfc76389fcf7fe1b88f2dd6e69600ab7f3af2
2019-10-27 08:59:08 -07:00
Ariel Mashraki
23cbf325c0 dialect/sql/schema: move MySQL logic to its own file
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/128

Reviewed By: alexsn

Differential Revision: D18164283

fbshipit-source-id: da6b4d6df89ae4172d8f47a7790c4dac3a8ffe93
2019-10-27 08:59:08 -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
bd07c86b60 all: add license header to all go files
Summary:
Used addlicense to generate this:
 addlicense -c "Facebook Inc" -f license_header .

example was taken from: https://github.com/facebook/litho/blob/master/lib/soloader/BUCK

Reviewed By: alexsn

Differential Revision: D17070152

fbshipit-source-id: e7b91398d7f6181727be3400c1872ad5f28e38ed
2019-08-27 04:48:28 -07:00
Ariel Mashraki
e0e754717e ent: change ent package name (#1338)
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1338

Pull Request resolved: https://github.com/facebookincubator/ent/pull/14

Reviewed By: alexsn

Differential Revision: D16890825

fbshipit-source-id: 656baaa73f5debab08c849b6b9639caeec2a8ef1
2019-08-19 09:32:14 -07:00
Ariel Mashraki
4ac1b595bf ent/schema: fix indexes in mysql versions <= 5.6
Summary: move property type uniqueness enforment to ent schema

Reviewed By: alexsn

Differential Revision: D16767355

fbshipit-source-id: db6ba4853a8816fd5f6299a34c0b780028d75da1
2019-08-13 07:41:23 -07:00
Ariel Mashraki
329b5ddf77 ent/sql/migrate: support indexes
Reviewed By: alexsn

Differential Revision: D16711184

fbshipit-source-id: 632b02c5c77c6289b242263647d45d9f28752e3f
2019-08-11 05:47:18 -07:00
Ariel Mashraki
b5cdb810b8 dialect/sql/schema: universl id allocation support
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/9

Reviewed By: alexsn

Differential Revision: D16252229

fbshipit-source-id: 795b6556d322e5c1ff5fb826c3b06ba5421ac857
2019-07-15 02:30:41 -07:00
Ariel Mashraki
4b176495e8 add support for all int types in schema
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/8

Reviewed By: alexsn

Differential Revision: D16131257

fbshipit-source-id: 7b362740053c684f70ec69188b2fcee898605436
2019-07-10 09:24:31 -07:00
Ariel Mashraki
e8e96f014f add charset support for fields
Summary: Basically, adding support for Hebrew characters.

Reviewed By: alexsn

Differential Revision: D16068537

fbshipit-source-id: 4e934da5ea97c9e804317f746556ab1d51faebcc
2019-07-01 08:10:24 -07:00
Ariel Mashraki
0e605681b2 quote table name on DESCRIBE statement (#7)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/7

avoid conflicting with reserved words (e.g. "groups" became reserved word in MySQL 8.x)

Reviewed By: alexsn

Differential Revision: D15957279

fbshipit-source-id: b6944752c7e5f6ec37119b11cc0ab8a0d7d3a7ff
2019-06-23 01:51:28 -07:00
Ariel Mashraki
5ca9494121 enable sql dialect option on integration env (#1014)
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1014

Pull Request resolved: https://github.com/facebookincubator/ent/pull/6

Reviewed By: alexsn

Differential Revision: D15928002

fbshipit-source-id: 4b5a639405f218f6b6cc90d152380d2fc9525a3f
2019-06-21 05:15:52 -07:00
Ariel Mashraki
970a410b31 add tests for sqlite migration
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/5

Reviewed By: alexsn

Differential Revision: D15875669

fbshipit-source-id: 5ddebe396b9683f364e91f2f9e6296e3659ff618
2019-06-18 10:55:48 -07:00
Ariel Mashraki
4f31aa6cfe imporve sql migration (#3)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/3

add an append-only mode to the migration

Reviewed By: alexsn

Differential Revision: D15845370

fbshipit-source-id: f22ae1866d4bb9250bf2d1c6cba476d574a3f45d
2019-06-17 04:23:24 -07:00
facebook-github-bot
267e3c15bd Initial commit
fbshipit-source-id: c79a38536e3c128dce1b2948615b72ec9779ed22
2019-06-16 04:37:51 -07:00