Skip to content

Commit

Permalink
Added behaviour table
Browse files Browse the repository at this point in the history
  • Loading branch information
DanZfsd committed Jun 15, 2024
1 parent 2547f98 commit 88bfc66
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { DataType } from "sequelize-typescript";

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

const TABLE_NAME = "behaviours";

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

export const down: Migration = async ({ context: sequelize }) => {
await sequelize.getQueryInterface().dropTable(TABLE_NAME);
};
7 changes: 7 additions & 0 deletions backend/typescript/models/behaviour.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Column, Model, Table } from "sequelize-typescript";

@Table({ tableName: "behaviours" })
export default class Behaviour extends Model {
@Column
behaviour_name!: string;
}

0 comments on commit 88bfc66

Please sign in to comment.