Commit Graph

25 Commits

Author SHA1 Message Date
yetone 9a61ef2af8
fix: duplicated preload (#6948) 2024-04-15 11:20:20 +08:00
Alexis Viscogliosi a2cac75218
feature: bring custom type and id column name to polymorphism (#6716)
* feature: bring custom type and id column name to polymorphism

* relationship: better returns for hasPolymorphicRelation

* fix: tests
2023-12-15 16:36:08 +08:00
mohammad ali 26663ab9bf
max identifier length changed to 63 (#6337)
* max identifier length changed to 63

* default maxIdentifierLength is 64

* renamed License to LICENSE (#6336)

* Added support of "Violates Foreign Key Constraint" (#6329)

* Added support of "Violates Foreign Key Constraint"

Updated the translator and added the support of "foreign key constraint violation". For this, this error type is needed here.

* changed the description of ErrForeignKeyViolated

* refactor: error translator test (#6350)

Co-authored-by: Saeid Saeidee <s.saeidee@sensysgatso.com>

* fix(nested transaction): SavePoint SQL Statement not support in Prepared Statements (#6220)

* test: add nested transaction and prepareStmt coexist test case

note: please test in the MySQL environment

Change-Id: I0db32adc5f74b0d443e98943d3b182236583b959
Signed-off-by: 王柳洋 <wangliuyang.520@bytedance.com>

* fix(nested transaction): SavePoint SQL Statement not support in Prepared Statements

1. SavetPoint SQL Statement not support in Prepared Statements
 e.g. see mysql8.0 doc: https://dev.mysql.com/doc/refman/8.0/en/sql-prepared-statements.html

Change-Id: I082012db9b140e8ec69764c633724665cc802692
Signed-off-by: 王柳洋 <wangliuyang.520@bytedance.com>

* revert(transaction_api): remove savepoint name pool,meaningless

Change-Id: I84aa9924fc54612005a81c83d66fdf8968ee56ad
Signed-off-by: 王柳洋 <wangliuyang.520@bytedance.com>

---------

Signed-off-by: 王柳洋 <wangliuyang.520@bytedance.com>
Co-authored-by: 王柳洋 <wangliuyang.520@bytedance.com>

* fix: save with hook (#6285) (#6294)

---------

Signed-off-by: 王柳洋 <wangliuyang.520@bytedance.com>
Co-authored-by: Avinaba Bhattacharjee <avinababhattacharjee2002@gmail.com>
Co-authored-by: Muhammad Amir Ejaz <37077032+codingamir@users.noreply.github.com>
Co-authored-by: Saeid <sk.saeidee@yahoo.com>
Co-authored-by: Saeid Saeidee <s.saeidee@sensysgatso.com>
Co-authored-by: wangliuyang <54885906+wangliuyang520@users.noreply.github.com>
Co-authored-by: 王柳洋 <wangliuyang.520@bytedance.com>
Co-authored-by: black-06 <hello.bug@foxmail.com>
2023-05-30 10:00:48 +08:00
black-06 828e22b17f
feat: support embedded preload (#6137)
* feat: support embedded preload

* fix lint and test

* fix test...
2023-04-11 13:10:38 +08:00
Jinzhu 3a72ba102e Allow shared foreign key for many2many jointable 2022-09-22 15:03:41 +08:00
Jinzhu e6f7da0e0d Support Variable Relation 2022-03-18 14:30:30 +08:00
Michael Nussbaum 45ef1da7e4
Fix naming longer then 64 chars with dots in table (#5045)
Ensures that foreign key relationships and indexes are given
syntactically valid names when their name length exceeds 64 characters
and they contained dot characters within the name. This is most often
relevant when a Postgres table name is fully qualified by including its schema
as part of its name
2022-02-24 10:10:20 +08:00
kinggo b47cf57f5e
ci: add gofumpt check in reviewdog (#4973) 2022-01-06 15:02:53 +08:00
Mayank Govilla d9d5c4dce0
Fix self-referential belongs to constraint (#4801)
* create tests for self-ref has one migration

* add relation equality check to avoid skipping self-referential schemas

* remove drop table error check
2021-11-08 09:47:29 +08:00
Paras Waykole 5d91ddac8c
fixed belongs_to & has_one reversed if field same (proper fix) (#4694)
* fixed belongs_to & has_one reversed if field same

* hasmany same foreign key bug fixed and test added

* belongsToSameForeignKey fixed and reverted old fix
2021-10-08 10:59:55 +08:00
Paras Waykole 79f427d862
fixed has_many stopped working if field names are identical (#4387)
* fixed belongs_to & has_one reversed if field same

* hasmany same foreign key bug fixed and test added
2021-05-19 16:05:29 +08:00
Paras Waykole 8f7f3ad315
fixed belongs_to & has_one reversed if field same (#4343) 2021-05-05 07:57:54 +08:00
Jinzhu 220349ccf2 Fix omit associations, close #4161 2021-03-19 15:15:26 +08:00
Jinzhu 628a0ae707 Fix foreign key & reference with same name, close #4081 2021-02-15 09:10:51 +08:00
Jinzhu 6095dbf939 Fix parse embedded relations, close #3964, #3965 2021-01-19 15:40:04 +08:00
Jinzhu 065787c54e Compatible with with foreign key with ID suffix #3890 2020-12-28 18:20:55 +08:00
Jinzhu 8bf50a5592 Fix parse relations if only specfied References, close #3890 2020-12-28 17:58:12 +08:00
Jinzhu f6ed895caf Build relationships if fields are not ignored, fix #3181 2020-09-09 16:37:05 +08:00
Jinzhu 6e38a2c2d5 Fix many2many join table name rule 2020-09-06 10:51:21 +08:00
Jinzhu 162367be7d Fix multiple M2M relations on one table, close #3347 2020-09-01 11:30:16 +08:00
Jinzhu c19a3abefb Fix self-referential belongs to, close #3319 2020-08-28 11:31:13 +08:00
Jinzhu d4f8a52442 Fix join table foreign key in snake_case 2020-07-04 07:24:46 +08:00
Jinzhu e986371a42 Rename package name 2020-06-02 09:18:01 +08:00
Jinzhu 76b8e78dcb Add multi primary keys test 2020-06-01 08:13:16 +08:00
Jinzhu 49310d0974 Test override foreign key, reference 2020-05-31 17:42:21 +08:00