34 Commits

Author SHA1 Message Date
Ariel Mashraki
5cd2ede22d dialect/entsql: add Skip annotation (#4156) 2024-07-26 23:03:21 +03:00
Ariel Mashraki
9aba4ae091 entc/gen: initial work for multi-schema migration using atlasgo.io (#3821) 2023-11-13 12:35:31 +02:00
Anton Telyshev
148f7d51a0 entc/gen: add redundant any() to withHooks to make linters work (#3360)
See https://github.com/golang/go/issues/58633 for more info.
2023-03-12 11:47:07 +02:00
Zhizhen He
7aea5a82bc golangci: remove deprecated linters (#3315) 2023-02-14 08:18:03 +02:00
Ariel Mashraki
baec350ed4 entc/gen: support type-based matching for edge-schema columns (#3306)
In case of no match by foreign-keys, we search by edge-type. This can happen if the type (edge owner)
is named T, but the edge-schema E names its edge field as u_id. We consider it as a match if
there is only one usage of T in E.
2023-02-07 10:58:20 +02:00
Ariel Mashraki
a91aabe3ef entc/gen: ensure foreign-key constraints are unique in codegen (#3066) 2022-11-05 07:28:50 +02:00
Ariel Mashraki
47972774c5 go: bump go/packages version ci to 1.18+1.19 (#2832)
* bumped pkg golang.org/x/tools version to address issue #2826

* .github: update go1.19 in go generate

Co-authored-by: Ankit Patial <ankitpatial@gmail.com>
2022-08-05 11:17:53 +03:00
Ariel Mashraki
5df06f49c1 go: update ariga.io/atlas (#2752) 2022-07-14 10:29:04 +03: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
89c339209e entc/gen: add the sql/execquery feature flag (#2447) 2022-04-06 13:34:22 +03:00
Ariel Mashraki
898991ac79 entc/gen: set foreign-key columns non-nullable for required edges (#1703)
Note, this only applies to edges without circular references.
Fixed #1688 and #1374
2022-01-23 22:23:37 +02:00
Alexander Melentyev
f6c9428978 ci: bump golangci-lint version (#2106) 2021-11-09 20:53:30 +02:00
Alexander Melentyev
b47b46ee6d ci: bump golangci-lint version (#2018)
* Bump golangci-lint version

* Fix linters issues

* Add exclude-rules for schema and test

* Fix cfg
2021-10-07 20:06:38 +03:00
Ariel Mashraki
f30a17edd4 all: fix linting issues before migrating to golangci v1.42 (#2019) 2021-10-07 19:54:43 +03:00
Alexander Melentyev
f5834b6fe6 Remove deprecated linter (#2017) 2021-10-07 18:58:07 +03:00
Ariel Mashraki
4c2faf2282 entc/gen: allow spaces in enum fields 2021-09-23 23:23:28 +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
Ciaran Liedeman
334e3abfd5 circleci: reduce funlen (#1243) 2021-02-06 18:25:39 +02:00
Ariel Mashraki
2ab0c682db entc/integ: add tests for default-func 2021-01-04 11:50:55 +02:00
Ariel Mashraki
5ddcc9aae3 golangci: remove old rules (#1042) 2020-12-14 09:05:07 +02:00
Ariel Mashraki
6aca5504ea entc/integration: add macaddr to integration tests (#965) 2020-11-20 23:19:25 +02:00
Ariel Mashraki
dfc4dee8a5 ent/privacy: initial privacy package (#836) 2020-10-11 14:27:29 +03:00
Ariel Mashraki
6299166f3b golangci: increase timeout 2020-09-02 17:27:33 +03:00
Alex Snast
7df2e02343 ci/lint: enabling goheader linter ensuring the existance of a license header in go files (#593)
Signed-off-by: Alex Snast <alexsn@fb.com>
2020-07-07 15:36:09 +03:00
Alex Snast
2fc6b276ee entc: adding template type option to --template flag (#488)
* entc: adding template type option to --template flag

Signed-off-by: Alex Snast <alexsn@fb.com>

* golangci: update funlen config

* cmd/entc: remove timestamp from logging

Co-authored-by: Ariel Mashraki <ariel@mashraki.co.il>
2020-05-12 12:19:14 +03:00
Alex Snast
60c90b3667 entc/gen/privacy: adding OnMutationOperation helper (#464)
Signed-off-by: Alex Snast <alexsn@fb.com>
2020-05-06 14:47:05 +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
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
b2ac0fe2e7 golangci: enable unused checker on postgres code
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/125

Reviewed By: alexsn

Differential Revision: D18137498

fbshipit-source-id: 74cfc51e179108b818ec544c3f59655f48164193
2019-10-25 07:40:44 -07:00
Ariel Mashraki
5f4a55ea1e sql/dialect/schema: load postgres table
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/107

Reviewed By: alexsn

Differential Revision: D18031837

fbshipit-source-id: 863f8db50a0547a7cb5e9ac560066fd6ee4e9c26
2019-10-20 05:20:16 -07:00
Ariel Mashraki
2b6c8eada3 dialect/sql/schema: initial interface for postgres API
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/101

Reviewed By: alexsn

Differential Revision: D17977541

fbshipit-source-id: 118f935e11449661fd91f87b94dde2fb62c9b912
2019-10-17 05:50:49 -07:00
Ariel Mashraki
638e34b11a circleci: disable deprecate lint error in load package
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/90

Reviewed By: alexsn

Differential Revision: D17899427

fbshipit-source-id: 607ae3f9b417671ee6affd0dc58811aa082580b3
2019-10-13 08:09:39 -07:00
Alex Snast
9983309eac ent/circleci: cache / restore go modules (#86)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/86

In addition rename run.deadline golangci-lint config to run.timeout

Reviewed By: a8m

Differential Revision: D17863321

fbshipit-source-id: f863bac6499ddd3066a3ec6e9f518c0d5156f117
2019-10-12 23:52:42 -07:00
Alex Snast
ce2bc07c1a ent/circleci: adding linter tests
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/80

Reviewed By: a8m

Differential Revision: D17837182

fbshipit-source-id: 9fb539fd6cebc064d2d2804bd52e0fbf413cfc93
2019-10-10 04:45:07 -07:00