22 lines
583 B
Plaintext
22 lines
583 B
Plaintext
import * as Knex from "knex";
|
|
|
|
<% if (d.tableName) { %>
|
|
export async function up(knex: Knex): Promise<Knex.SchemaBuilder> {
|
|
return knex.schema.createTable("<%= d.tableName %>", (t: Knex.AlterTableBuilder) => {
|
|
t.increments();
|
|
t.timestamps();
|
|
});
|
|
}
|
|
<% } else { %>
|
|
export async function up(knex: Knex): Promise<any> {
|
|
}
|
|
<% } %>
|
|
<% if (d.tableName) { %>
|
|
export async function down(knex: Knex): Promise<Knex.SchemaBuilder> {
|
|
return knex.schema.dropTable("<%= d.tableName %>");
|
|
}
|
|
<% } else { %>
|
|
export async function down(knex: Knex): Promise<any> {
|
|
}
|
|
<% } %>
|