xataio / pgroll

PostgreSQL zero-downtime migrations made easy
https://www.xata.io
Apache License 2.0
2.97k stars 54 forks source link

Incorrect success message if filename and migration name don't match #368

Open divyenduz opened 2 months ago

divyenduz commented 2 months ago
$ cat sql/1.json
{
  "name": "01_create_users_table",
  "operations": [
    {
      "create_table": {
        "name": "users",
        "columns": [
          {
            "name": "id",
            "type": "serial",
            "pk": true
          },
          {
            "name": "name",
            "type": "varchar(255)",
            "unique": true
          },
          {
            "name": "description",
            "type": "text",
            "nullable": true
          }
        ]
      }
    }
  ]
}
pgroll start sql/1.json --postgres-url 'postgresql://postgres:postgres@127.0.0.1/cal?sslmode=disable'
 SUCCESS  New version of the schema available under the postgres "public_1" schema

The success message incorrectly print schema name based on the filename (public_1). But the real schema in the database is called public_01_create_users_table