mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-23 00:10:27 +01:00
Working on v3
This commit is contained in:
18
database/migrations/1621542488791_golden_messages.ts
Normal file
18
database/migrations/1621542488791_golden_messages.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
||||
|
||||
export default class GoldenMessages extends BaseSchema {
|
||||
protected tableName = 'golden_messages'
|
||||
|
||||
public async up () {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id')
|
||||
table.integer('user_id').notNullable()
|
||||
table.string('message')
|
||||
table.timestamps(true)
|
||||
})
|
||||
}
|
||||
|
||||
public async down () {
|
||||
this.schema.dropTable(this.tableName)
|
||||
}
|
||||
}
|
||||
22
database/migrations/1621542495694_users.ts
Normal file
22
database/migrations/1621542495694_users.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
||||
|
||||
export default class Users extends BaseSchema {
|
||||
protected tableName = 'users'
|
||||
|
||||
public async up () {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id').primary()
|
||||
table.string('username', 255).notNullable()
|
||||
table.string('email', 255).notNullable()
|
||||
table.string('password', 180).notNullable()
|
||||
table.boolean('is_confirmed').defaultTo(false).notNullable()
|
||||
table.string('remember_me_token').defaultTo(null).nullable()
|
||||
table.string('confirmation_token').defaultTo(null).nullable()
|
||||
table.timestamps(true)
|
||||
})
|
||||
}
|
||||
|
||||
public async down () {
|
||||
this.schema.dropTable(this.tableName)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user