2023-11-28 00:16:50 +00:00
|
|
|
import type { Knex } from "knex";
|
2016-12-01 14:02:21 +05:30
|
|
|
|
2018-09-27 23:12:14 +10:00
|
|
|
<% if (d.tableName) { %>
|
|
|
|
export async function up(knex: Knex): Promise<Knex.SchemaBuilder> {
|
2021-03-11 18:58:00 +01:00
|
|
|
return knex.schema.createTable("<%= d.tableName %>", (t) => {
|
2016-12-01 14:02:21 +05:30
|
|
|
t.increments();
|
|
|
|
t.timestamps();
|
|
|
|
});
|
2019-03-05 16:37:43 +02:00
|
|
|
}
|
2018-09-27 23:12:14 +10:00
|
|
|
<% } else { %>
|
2020-05-22 14:48:38 -04:00
|
|
|
export async function up(knex: Knex): Promise<void> {
|
2019-03-05 16:37:43 +02:00
|
|
|
}
|
2018-09-27 23:12:14 +10:00
|
|
|
<% } %>
|
|
|
|
<% if (d.tableName) { %>
|
|
|
|
export async function down(knex: Knex): Promise<Knex.SchemaBuilder> {
|
2016-12-01 14:02:21 +05:30
|
|
|
return knex.schema.dropTable("<%= d.tableName %>");
|
2019-03-05 16:37:43 +02:00
|
|
|
}
|
2018-09-27 23:12:14 +10:00
|
|
|
<% } else { %>
|
2020-05-22 14:48:38 -04:00
|
|
|
export async function down(knex: Knex): Promise<void> {
|
2019-03-05 16:37:43 +02:00
|
|
|
}
|
2018-09-27 23:12:14 +10:00
|
|
|
<% } %>
|