rework and update deps

This commit is contained in:
2021-04-18 17:02:17 +02:00
commit 16216a4906
44 changed files with 5399 additions and 0 deletions

View File

@@ -0,0 +1 @@
// import Factory from '@ioc:Adonis/Lucid/Factory'

View File

@@ -0,0 +1,18 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class UsersSchema extends BaseSchema {
protected tableName = 'users'
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('email', 255).notNullable()
table.string('password', 180).notNullable()
table.timestamps(true)
})
}
public async down () {
this.schema.dropTable(this.tableName)
}
}

View File

@@ -0,0 +1,19 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class Links extends BaseSchema {
protected tableName = 'links'
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id')
table.string('code').notNullable()
table.string('target').notNullable()
table.integer('visit_count').defaultTo(0)
table.timestamps(true)
})
}
public async down () {
this.schema.dropTable(this.tableName)
}
}