Working on v3

This commit is contained in:
2021-05-20 22:30:44 +02:00
parent 0d9ff1c20d
commit 66b4709011
12 changed files with 4849 additions and 1 deletions

View 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)
}
}

View 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)
}
}