20241117173947_user.ts 552 B

12345678910111213141516
  1. // For more information about this file see https://dove.feathersjs.com/guides/cli/knexfile.html
  2. import type { Knex } from 'knex'
  3. export async function up(knex: Knex): Promise<void> {
  4. await knex.schema.createTable('users', (table) => {
  5. table.increments('id');
  6. table.string('username').unique();
  7. table.enum('role', ['user', 'moderator', 'admin']).defaultTo('user');
  8. table.string('email').unique();
  9. table.string('password');
  10. })
  11. }
  12. export async function down(knex: Knex): Promise<void> {
  13. await knex.schema.dropTable('users');
  14. }