diff options
Diffstat (limited to 'database/migrations/1503250034279_user.ts')
-rw-r--r-- | database/migrations/1503250034279_user.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/database/migrations/1503250034279_user.ts b/database/migrations/1503250034279_user.ts new file mode 100644 index 0000000..262a472 --- /dev/null +++ b/database/migrations/1503250034279_user.ts | |||
@@ -0,0 +1,20 @@ | |||
1 | import BaseSchema from '@ioc:Adonis/Lucid/Schema'; | ||
2 | |||
3 | export default class extends BaseSchema { | ||
4 | protected tableName = 'users'; | ||
5 | |||
6 | public async up(): Promise<void> { | ||
7 | this.schema.createTable(this.tableName, table => { | ||
8 | table.increments(); | ||
9 | table.string('username', 80).notNullable(); | ||
10 | table.string('email', 254).notNullable().unique(); | ||
11 | table.string('password', 60).notNullable(); | ||
12 | table.json('settings'); | ||
13 | table.timestamps(); | ||
14 | }); | ||
15 | } | ||
16 | |||
17 | public async down(): Promise<void> { | ||
18 | this.schema.dropTable(this.tableName); | ||
19 | } | ||
20 | } | ||