12345678910111213141516 |
- // For more information about this file see https://dove.feathersjs.com/guides/cli/knexfile.html
- import type { Knex } from 'knex'
- export async function up(knex: Knex): Promise<void> {
- await knex.schema.createTable('users', (table) => {
- table.increments('id');
- table.string('username').unique();
- table.enum('role', ['user', 'moderator', 'admin']).defaultTo('user');
- table.string('email').unique();
- table.string('password');
- })
- }
- export async function down(knex: Knex): Promise<void> {
- await knex.schema.dropTable('users');
- }
|