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:
[ ] question [x] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova [x] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [ ] postgres [ ] cockroachdb [ ] sqlite [ ] sqljs [ ] react-native [ ] expo
cordova
mongodb
mssql
mysql
mariadb
oracle
postgres
cockroachdb
sqlite
sqljs
react-native
expo
TypeORM version:
[x] latest [ ] @next [ ] 0.x.x (or put your version here)
latest
@next
0.x.x
Steps to reproduce or a small repository showing the problem:
Currently, expireAfterSeconds: 0 can't be passed to Index decorator:
expireAfterSeconds: 0
import { Column, Entity, Index, getMetadataArgsStorage } from 'typeorm'; @Entity() export class Foo { @Column('date') @Index({ expireAfterSeconds: 0 }) expireAt: Date; } console.log(getMetadataArgsStorage().indices); /* [ { target: [Function: Foo], name: undefined, columns: [ 'expireAt' ], synchronize: true, where: undefined, unique: false, spatial: false, fulltext: false, sparse: false, background: false, expireAfterSeconds: undefined } ] */
We can fix that with one line change:
diff --git a/src/decorator/Index.ts b/src/decorator/Index.ts index 7b6197b..45683a5 100644 --- a/src/decorator/Index.ts +++ b/src/decorator/Index.ts @@ -79,7 +79,7 @@ export function Index(nameOrFieldsOrOptions?: string|string[]|((object: any) => fulltext: options && options.fulltext ? true : false, sparse: options && options.sparse ? true : false, background: options && options.background ? true : false, - expireAfterSeconds: options && options.expireAfterSeconds ? options.expireAfterSeconds : undefined + expireAfterSeconds: options ? options.expireAfterSeconds : undefined } as IndexMetadataArgs); }; }
I will make a PR.
The text was updated successfully, but these errors were encountered:
d05467c
No branches or pull requests
Issue type:
[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[x]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
Currently,
expireAfterSeconds: 0
can't be passed to Index decorator:We can fix that with one line change:
I will make a PR.
The text was updated successfully, but these errors were encountered: