Skip to content

Commit

Permalink
Merge pull request #8 from uwblueprint/S24/sayi/add-activities-table
Browse files Browse the repository at this point in the history
Add Activities table
  • Loading branch information
sthuray authored Jun 22, 2024
2 parents 0a770b4 + 16101c7 commit fb3e845
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 = "activities";

export const up: Migration = async ({ context: sequelize }) => {
await sequelize.getQueryInterface().createTable(TABLE_NAME, {
id: {
type: DataType.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
activity_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/activity.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: "activities" })
export default class Activities extends Model {
@Column
activity_name!: string;
}

0 comments on commit fb3e845

Please sign in to comment.