Skip to content

Commit

Permalink
add primary key to WasmCodeKeyIds table
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Jun 12, 2024
1 parent 69671db commit 249d690
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/db/migrations/20240521022046-create-wasm-code-key-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { DataType } from 'sequelize-typescript'
module.exports = {
async up(queryInterface: QueryInterface) {
await queryInterface.createTable('WasmCodeKeyIds', {
id: {
primaryKey: true,
autoIncrement: true,
type: DataType.INTEGER,
},
codeKey: {
allowNull: false,
type: DataType.STRING,
Expand Down
5 changes: 5 additions & 0 deletions src/db/models/WasmCodeKeyId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
BelongsTo,
Column,
Model,
PrimaryKey,
Table,
} from 'sequelize-typescript'

Expand All @@ -18,6 +19,10 @@ import { WasmCodeKey } from './WasmCodeKey'
],
})
export class WasmCodeKeyId extends Model {
@PrimaryKey
@Column
declare id: number

@AllowNull(false)
@Column
declare codeKey: string
Expand Down

0 comments on commit 249d690

Please sign in to comment.