22 lines
565 B
Plaintext
Raw Permalink Normal View History

import type { Knex } from "knex";
<% if (d.tableName) { %>
export async function up(knex: Knex): Promise<Knex.SchemaBuilder> {
return knex.schema.createTable("<%= d.tableName %>", (t) => {
t.increments();
t.timestamps();
});
2019-03-05 16:37:43 +02:00
}
<% } else { %>
export async function up(knex: Knex): Promise<void> {
2019-03-05 16:37:43 +02:00
}
<% } %>
<% if (d.tableName) { %>
export async function down(knex: Knex): Promise<Knex.SchemaBuilder> {
return knex.schema.dropTable("<%= d.tableName %>");
2019-03-05 16:37:43 +02:00
}
<% } else { %>
export async function down(knex: Knex): Promise<void> {
2019-03-05 16:37:43 +02:00
}
<% } %>