Skip to content

Commit

Permalink
Add Activities table
Browse files Browse the repository at this point in the history
  • Loading branch information
sthuray committed Jun 15, 2024
1 parent 2547f98 commit 796e789
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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, {

Check failure on line 8 in backend/typescript/migrations/2024.06.12T01.50.03.create-activities-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
activity_id: {

Check failure on line 9 in backend/typescript/migrations/2024.06.12T01.50.03.create-activities-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `····`
type: DataType.INTEGER,

Check failure on line 10 in backend/typescript/migrations/2024.06.12T01.50.03.create-activities-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Replace `··········` with `······`
allowNull: false,

Check failure on line 11 in backend/typescript/migrations/2024.06.12T01.50.03.create-activities-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `····`
primaryKey: true,

Check failure on line 12 in backend/typescript/migrations/2024.06.12T01.50.03.create-activities-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Replace `··········` with `······`
autoIncrement: true,

Check failure on line 13 in backend/typescript/migrations/2024.06.12T01.50.03.create-activities-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `····`
},

Check failure on line 14 in backend/typescript/migrations/2024.06.12T01.50.03.create-activities-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `····`
activity_name: {

Check failure on line 15 in backend/typescript/migrations/2024.06.12T01.50.03.create-activities-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Replace `········` with `····`
type: DataType.STRING,

Check failure on line 16 in backend/typescript/migrations/2024.06.12T01.50.03.create-activities-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `····`
allowNull: false,

Check failure on line 17 in backend/typescript/migrations/2024.06.12T01.50.03.create-activities-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Replace `··········` with `······`
},
createdAt: DataType.DATE,
updatedAt: DataType.DATE,
});
};

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

@Table({ tableName: "activities" })
export default class Activities extends Model {

@Column
activity_name!: string;
}

0 comments on commit 796e789

Please sign in to comment.