Commit Graph

30 Commits

Author SHA1 Message Date
Ariel Mashraki
013c185b4a entc/integ: minor style changes in integration (#978) 2020-11-24 19:47:24 +02:00
Ciaran Liedeman
bbd41dbc87 dialect/sql/schema: integer to string (#954)
* Allow migrations from integer to string with max length

* switched to entsql.Annotation

* removed manual conversion size checks

* fixed unit tests
2020-11-24 18:09:40 +02:00
Ciaran Liedeman
f655a59089 entc/integration: add postgres13 (#961) 2020-11-19 14:46:02 +02:00
Ciaran Liedeman
e26d81d9a5 dialect/sql/schema: allow migrations from integer to string without size limit (#952)
* Allow migrations from integer to string without size limit

* Update entc/integration/migrate/entv1/schema/user.go

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

* run generate

* Update entc/integration/migrate/entv2/schema/user.go

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

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2020-11-16 11:44:04 +02:00
Ariel Mashraki
13b379d07c dialect/sql/schema: properly handle indexes of tables with uncountable name (#828) 2020-10-08 23:24:54 +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
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
59f172f06a entc/integration/migrate: add integration tests for migrate 2020-01-01 19:12:11 +02:00
Ariel Mashraki
798d58f02b all: use more go-ish error for constraint failures 2019-12-17 23:17:55 +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
38fcf995d0 entc/integration/migrate: enable postgres 10,11 in migrate test
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/132

Reviewed By: alexsn

Differential Revision: D18203398

fbshipit-source-id: a261ed3934d2e4262d7177b41546b2239e798ef5
2019-10-29 10:16:50 -07:00
Alex Snast
ac50ea81d4 ent: address several lint errors throughout the project (#1534)
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1534

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

lint errors detected by running `golangci-lint` tool.

Reviewed By: a8m

Differential Revision: D17784980

fbshipit-source-id: f7e8bd99fdf1e018d5672cea1e8d44b67f2a4201
2019-10-06 23:59:12 -07:00
Ariel Mashraki
1ebfa489c5 ent: add support for enum types
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/45

Reviewed By: alexsn

Differential Revision: D17715085

fbshipit-source-id: 7472e1bd9cf7a8a5bd98f96e6e884c0e27f36803
2019-10-02 12:55:28 -07:00
Ariel Mashraki
624ecd2cc7 schema/field: add storage-key option
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/35

Reviewed By: alexsn

Differential Revision: D17394930

fbshipit-source-id: bc9d8cc6569ad457b93d47d26d143f2442f98df9
2019-09-16 04:39:17 -07:00
Ariel Mashraki
7dfe3c174c sql/schema: more precise blob definition
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/29

Reviewed By: alexsn

Differential Revision: D17284406

fbshipit-source-id: 84c2ffb50b8f016ad361f1420c5352c7969cbc77
2019-09-10 12:40:37 -07:00
Alex Snast
b71ee6820b ent/schema: remove string field charset / collation settings
Summary: don't expose starage specific features in ent schema

Reviewed By: a8m

Differential Revision: D17111724

fbshipit-source-id: fca9e624b272c0db3fed14c511fa6cb07816a100
2019-08-29 07:38:39 -07:00
Ariel Mashraki
dc542e46ae entc/gen: add debug option to client
Summary:
It's possible to execute:
```
client.Debug().T.Query().AllX(ctx)
``

Reviewed By: alexsn

Differential Revision: D17092159

fbshipit-source-id: 6d1c56e8e45cfd8e36b2700c9d450f2bd5f66a71
2019-08-28 07:23:28 -07:00
Ariel Mashraki
e7fec6f8f9 entc/gen: change verbose option to debug
Summary: Change the Verbose option to Debug

Reviewed By: alexsn

Differential Revision: D17091911

fbshipit-source-id: c5cf3e1c7f33f607076fe5c7da94e04b9f236218
2019-08-28 06:45:59 -07:00
Alex Snast
4c1f28d58f ent/schema: allow setting collation for string fields
Reviewed By: a8m

Differential Revision: D17090481

fbshipit-source-id: a08768c9bac4318a91bc6a067c85d6eb022c3024
2019-08-28 04:52:32 -07:00
Alex Snast
373769dfaf ent/gen: adding EqualFold predicate for string fields
Summary: Similar to `ContainsFold` predicate requires `--storage=sql` argument to be passed to entc.

Reviewed By: a8m

Differential Revision: D17074805

fbshipit-source-id: ced299154417fe2c9007cd6a7a504f53c8b2ef98
2019-08-27 10:48:53 -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
3bd8c27cb9 entc/predicate: add containsfold sql dialects (#23)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/23

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

Reviewed By: alexsn

Differential Revision: D16961334

fbshipit-source-id: 759737dd716efca01b1089715907e92fa2b4c8c7
2019-08-22 06:23:31 -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
c16d3c8e25 ent/schema: explicitly defines non-null fields in schema
Reviewed By: alexsn

Differential Revision: D16791620

fbshipit-source-id: bad3ac7b2349d2f483c804eb3623c6dfa8b06313
2019-08-15 03:37:17 -07:00
Ariel Mashraki
2128fc2ca1 ent/index: add indexes api
Reviewed By: alexsn

Differential Revision: D16757699

fbshipit-source-id: 6a0027b1f855721f1415b8c72b5b1be8bc2ce902
2019-08-12 06:44:40 -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
2cc8286f5f entc: add idtype option codegen
Reviewed By: alexsn

Differential Revision: D16601757

fbshipit-source-id: 35d5fbfb4ef40bae192e084ad4e067880175e71c
2019-08-04 03:13:01 -07:00
Ariel Mashraki
c203f043cf ent: add blob tyoe
Reviewed By: idoshveki

Differential Revision: D16600425

fbshipit-source-id: 04c6fe39f9b3b628a1e79eb3063188f582d9e504
2019-08-01 07:45:05 -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