We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue type:
[x] question [x] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [ ] postgres [ ] cockroachdb [x] sqlite [ ] sqljs [ ] react-native [ ] expo
cordova
mongodb
mssql
mysql
mariadb
oracle
postgres
cockroachdb
sqlite
sqljs
react-native
expo
TypeORM version:
[ ] latest [ ] @next [x] 0.2.12
latest
@next
0.2.12
Steps to reproduce or a small repository showing the problem:
I have this schema:
export default new EntitySchema({ tableName: 'vat', target: Vat, columns: { id: { type: 'integer', primary: true, generated: true }, name: { type: 'varchar', length: 32, unique: true }, rate: { type: 'integer' }, notes: { type: 'text', nullable: true }, }, checks: [ { name: 'rate_gt_0', expression: '"rate" > 0' }, ], });
but the result query is without unique in name column:
CREATE TABLE "vat" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(32) NOT NULL, "rate" integer NOT NULL, "notes" text, CONSTRAINT "rate_gt_0" CHECK ("rate" > 0))
what's the error in my schema declaration?
Thanks
The text was updated successfully, but these errors were encountered:
@pleerock is this behaviour by design (wrong typings) or it is bug and unique option on column should works? I think it should works.
unique
@chiaraperino From documentation you can define indices and uniques by separate options:
export const PersonSchema = new EntitySchema({ // ... columns: { // ... }, checks: [ // ... ], indices: [ { name: "IDX_TEST", unique: true, columns: [ "firstName", "lastName" ] } ], uniques: [ { name: "UNIQUE_TEST", columns: [ "firstName", "lastName" ] } ] });
Sorry, something went wrong.
e63cce9
Merge pull request #3838 from typeorm/fix-3803
86362db
Fix #3803
fix #3803
9b998ae
AlexMesser
No branches or pull requests
Issue type:
[x] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
cockroachdb
[x]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[ ]
latest
[ ]
@next
[x]
0.2.12
Steps to reproduce or a small repository showing the problem:
I have this schema:
but the result query is without unique in name column:
what's the error in my schema declaration?
Thanks
The text was updated successfully, but these errors were encountered: