Skip to content

sqitch upgrade should create schema if not exists #870

@lorddaedra

Description

@lorddaedra

We should add ability to create sqitch schema without first deploy. Because of sometimes we do not need real first deploy, we would like to "fake" it (mark some migration as deployed without actual changes). But it's not possible to do without sqitch schema with several tables.

docker rm -f third && docker run --name third \
 -e POSTGRES_USER=third \
 -e POSTGRES_PASSWORD=third \
 -e POSTGRES_DB=third \
 -p 5433:5432 \
 -d postgres:15

sqitch upgrade --target db:pg://third:third@localhost:5433/third
Upgrading registry db:pg://third@localhost:5433/third to version 1.1
Upgrading the Sqitch registry from 0 to 1.1
  * From 0 to 1.0
psql:/usr/local/Cellar/sqitch/1.5.0/lib/perl5/App/Sqitch/Engine/Upgrade/pg-1.0.sql:10: ERROR:  schema "sqitch" does not exist
LINE 1: CREATE TABLE "sqitch".releases (
                     ^
"/usr/local/bin/psql" unexpectedly returned exit value 3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions