svelte-website/src/lib/db/migrations/20220820100623_create-users...

20 lines
499 B
TypeScript

import type { Knex } from "knex";
export async function up(knex: Knex): Promise<void> {
return knex.schema.createTable("users", (table) => {
table.increments("userid", { primaryKey: true });
table.string("username", 255).notNullable;
table.string("email", 255).notNullable;
table.string("password", 64).notNullable;
table.string("website", 255);
table.timestamps(true, true);
});
}
export async function down(knex: Knex): Promise<void> {
return knex.schema.dropTable("users");
}