node.js - 如何设置模态数据库 postgresSQL
问题描述
我正在为我的数据库使用 postgres,并且我正在尝试为每个团队创建一个规则
这是我的数据库中的以下代码:
module.exports = (sequelize, DataTypes) => {
const Team = sequelize.define(
"Team",
{
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
allowNull: false,
},
title: {
type: DataTypes.STRING,
allowNull: false,
},
type: DataTypes.STRING,
mission: DataTypes.STRING,
agreement: DataTypes.STRING,
},
{
tableName: "Teams",
timestamps: true,
indexes: [{ unique: false, fields: ["id", "title"] }],
}
);
所以协议数据类型是我的规则。我是否需要将其更改为数组并在模式中创建 4 条规则,或者无论如何我可以用字符串来做到这一点?
解决方案
推荐阅读
- nlp - IBM Watson Assistant:当我在意图训练问题中使用@entity 时,watson 不会平等对待所有实体值
- node.js - 将 var 服务器传递给另一个 nodejs 模块
- google-chrome - 二级域中特殊字符的编码是什么?
- javascript - NodeJS CSVReader - 带有 csv-parse 的 createReadStream 返回空数组
- c# - 如何限制列表的大小并使用新值循环 FIFO?
- c# - 使用 XamlReader.Load 反序列化后 UI 上缺少值
- java - 为什么我的 Android 应用没有扫描蓝牙设备?
- java - 我如何更改由 Repository.findAll() 在 Spring Boot 中创建的 json 数组的格式
- c# - 标签使用 RightToLeft 错误地显示标点符号
- java - Java 客户端 OCSP 抛出“无法确定吊销状态”