dijkstra-backend-cloudron/node_modules/knex/lib/migrate/stub/ts.stub

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> {
}
<% } %>