Initial commit
This commit is contained in:
21
node_modules/knex/lib/migrations/migrate/stub/ts-schema.stub
generated
vendored
Executable file
21
node_modules/knex/lib/migrations/migrate/stub/ts-schema.stub
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
import { Knex } from "knex";
|
||||
|
||||
<% if (d.tableName) { %>
|
||||
export async function up({schema}: Knex): Promise<Knex.SchemaBuilder> {
|
||||
return schema.createTable("<%= d.tableName %>", (t) => {
|
||||
t.increments();
|
||||
t.timestamps();
|
||||
});
|
||||
}
|
||||
<% } else { %>
|
||||
export async function up({schema}: Knex): Promise<void> {
|
||||
}
|
||||
<% } %>
|
||||
<% if (d.tableName) { %>
|
||||
export async function down({schema}: Knex): Promise<Knex.SchemaBuilder> {
|
||||
return schema.dropTable("<%= d.tableName %>");
|
||||
}
|
||||
<% } else { %>
|
||||
export async function down({schema}: Knex): Promise<void> {
|
||||
}
|
||||
<% } %>
|
||||
Reference in New Issue
Block a user