feat: Add status column to user model
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
export async function up(knex) {
|
||||||
|
return knex.schema.table('users', (table) => {
|
||||||
|
table.string('status').defaultTo('active');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down(knex) {
|
||||||
|
return knex.schema.table('users', (table) => {
|
||||||
|
table.dropColumn('status');
|
||||||
|
});
|
||||||
|
}
|
@@ -33,8 +33,16 @@ class User extends Base {
|
|||||||
fullName: { type: 'string', minLength: 1 },
|
fullName: { type: 'string', minLength: 1 },
|
||||||
email: { type: 'string', format: 'email', minLength: 1, maxLength: 255 },
|
email: { type: 'string', format: 'email', minLength: 1, maxLength: 255 },
|
||||||
password: { type: 'string' },
|
password: { type: 'string' },
|
||||||
|
status: {
|
||||||
|
type: 'string',
|
||||||
|
enum: ['active', 'pending'],
|
||||||
|
default: 'active',
|
||||||
|
},
|
||||||
resetPasswordToken: { type: ['string', 'null'] },
|
resetPasswordToken: { type: ['string', 'null'] },
|
||||||
resetPasswordTokenSentAt: { type: ['string', 'null'], format: 'date-time' },
|
resetPasswordTokenSentAt: {
|
||||||
|
type: ['string', 'null'],
|
||||||
|
format: 'date-time',
|
||||||
|
},
|
||||||
trialExpiryDate: { type: 'string' },
|
trialExpiryDate: { type: 'string' },
|
||||||
roleId: { type: 'string', format: 'uuid' },
|
roleId: { type: 'string', format: 'uuid' },
|
||||||
deletedAt: { type: 'string' },
|
deletedAt: { type: 'string' },
|
||||||
@@ -381,7 +389,7 @@ class User extends Base {
|
|||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
fullName,
|
fullName,
|
||||||
roleId: adminRole.id
|
roleId: adminRole.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
await Config.markInstallationCompleted();
|
await Config.markInstallationCompleted();
|
||||||
|
Reference in New Issue
Block a user