Skip to content

Commit

Permalink
added migration file
Browse files Browse the repository at this point in the history
  • Loading branch information
trinity-y committed Jun 15, 2024
1 parent 261b10a commit 9e1ad96
Show file tree
Hide file tree
Showing 4 changed files with 15,801 additions and 3,308 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { DataType } from "sequelize-typescript";

import { Migration } from "../umzug";

const TABLE_NAME = "animal_types";

export const up: Migration = async ({ context: sequelize }) => {
await sequelize.getQueryInterface().createTable(TABLE_NAME, {
animal_type_id: {
type: DataType.INTEGER,
primaryKey: true,
autoIncrement: true,
},
animal_type_name: {
type: DataType.STRING,
allowNull: false,
},
createdAt: DataType.DATE,
updatedAt: DataType.DATE,
});
};

export const down: Migration = async ({ context: sequelize }) => {
await sequelize.getQueryInterface().dropTable(TABLE_NAME);
};
Loading

0 comments on commit 9e1ad96

Please sign in to comment.