📜  在 sequelize 中引用另一个模式 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:55.291000             🧑  作者: Mango

代码示例1
queryInterface.createTable(
          "MyTable",
          {
            id: {
              type: Sequelize.INTEGER,
              primaryKey: true,
              autoIncrement: true,
            },
            SomeTableId: {
              type: Sequelize.INTEGER,
              references: {
                model: {
                  tableName: "SomeTable",
                  schema: "static",
                },
                key: "id",
              },
              allowNull: false,
            },
          },
          t
        );