使用Alembic创建数据库

问题描述 投票:-1回答:1

我有使用database1的数据库迁移。我正在将其用于Alembic迁移。

如何在运行Alembic之前创建数据库database1

我已经使用CloudFormation创建了数据库基础架构。而且,当我们运行第一次迁移时,我需要运行SQL create database database1或类似的东西。

python-3.x alembic database-versioning
1个回答
0
投票

我最终使用@SuperShoot的建议。我修改了我的CFT,使其包含在摘要下方

  "Parameters": {
    "DBName": {
      "Default": "<database name>",
      "Description": "The database name",
      "Type": "String",
      ...
    },
    ...
  }, 
  "Resources": {
   "RDSinstance": {
      "Type": "AWS::RDS::DBInstance",
      "Properties": {
        "DBName": {
          "Ref": "DBName"
        },
        ...
      }
    }, 
    ...
  }

© www.soinside.com 2019 - 2024. All rights reserved.