- second commit

This commit is contained in:
Kaimbacher 2023-03-17 16:13:37 +01:00
parent 4fc3bb0a01
commit 59a99ff3c8
61 changed files with 2625 additions and 1182 deletions

View file

@ -1,25 +1,25 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
import Config from '@ioc:Adonis/Core/Config'
import BaseSchema from '@ioc:Adonis/Lucid/Schema';
import Config from '@ioc:Adonis/Core/Config';
export default class Roles extends BaseSchema {
protected tableName = Config.get('rolePermission.role_table', 'roles')
protected tableName = Config.get('rolePermission.role_table', 'roles');
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id')
table.string('name', 191).unique()
table.string('slug', 191).nullable().unique()
table.string('description', 191).nullable()
public async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id');
table.string('name', 191).unique();
table.string('slug', 191).nullable().unique();
table.string('description', 191).nullable();
/**
* Uses timestamptz for PostgreSQL and DATETIME2 for MSSQL
*/
table.timestamp('created_at', { useTz: true }).nullable()
table.timestamp('updated_at', { useTz: true }).nullable()
})
}
/**
* Uses timestamptz for PostgreSQL and DATETIME2 for MSSQL
*/
table.timestamp('created_at', { useTz: true }).nullable();
table.timestamp('updated_at', { useTz: true }).nullable();
});
}
public async down () {
this.schema.dropTable(this.tableName)
}
public async down() {
this.schema.dropTable(this.tableName);
}
}