2022-03-28 15:13:22 -04:00
|
|
|
"use strict"
|
|
|
|
import { DataTypes } from "sequelize"
|
|
|
|
import type { Migration } from "../database"
|
|
|
|
|
|
|
|
export const up: Migration = async ({ context: queryInterface }) =>
|
2022-03-29 03:19:33 -04:00
|
|
|
queryInterface.createTable("posts", {
|
|
|
|
id: {
|
|
|
|
type: DataTypes.UUID,
|
|
|
|
defaultValue: DataTypes.UUIDV4,
|
|
|
|
primaryKey: true,
|
|
|
|
unique: true
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
type: DataTypes.STRING
|
|
|
|
},
|
|
|
|
visibility: {
|
|
|
|
type: DataTypes.STRING
|
|
|
|
},
|
|
|
|
password: {
|
|
|
|
type: DataTypes.STRING
|
|
|
|
},
|
|
|
|
createdAt: {
|
|
|
|
type: DataTypes.DATE
|
|
|
|
},
|
|
|
|
updatedAt: {
|
|
|
|
type: DataTypes.DATE
|
|
|
|
},
|
|
|
|
deletedAt: {
|
|
|
|
type: DataTypes.DATE
|
|
|
|
}
|
|
|
|
})
|
2022-03-28 15:13:22 -04:00
|
|
|
|
|
|
|
export const down: Migration = async ({ context: queryInterface }) =>
|
2022-03-29 03:19:33 -04:00
|
|
|
await queryInterface.dropTable("posts")
|