Initial commit

This commit is contained in:
2025-10-13 00:23:31 -03:00
commit 42921527f8
725 changed files with 91395 additions and 0 deletions
@@ -0,0 +1,54 @@
import { QueryInterface, DataTypes } from "sequelize";
module.exports = {
up: (queryInterface: QueryInterface) => {
return queryInterface.createTable("Chats", {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
allowNull: false
},
title: {
type: DataTypes.TEXT,
defaultValue: "",
allowNull: true
},
uuid: {
type: DataTypes.STRING,
defaultValue: "",
allowNull: true
},
ownerId: {
type: DataTypes.INTEGER,
references: { model: "Users", key: "id" },
onUpdate: "CASCADE",
onDelete: "CASCADE",
allowNull: false
},
lastMessage: {
type: DataTypes.TEXT,
allowNull: true
},
companyId: {
type: DataTypes.INTEGER,
references: { model: "Companies", key: "id" },
onUpdate: "CASCADE",
onDelete: "CASCADE",
allowNull: false
},
createdAt: {
type: DataTypes.DATE,
allowNull: false
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false
}
});
},
down: (queryInterface: QueryInterface) => {
return queryInterface.dropTable("Chats");
}
};