Questions tagged [sqitch]

Sqitch is a database change management application.

Sqitch is an open source database change management application written in Perl.

The following is an excerpt from the project website.

What makes it different from your typical migration-style approaches? A few things:

No opinions
Sqitch is not integrated with any framework, ORM, or platform. Rather, it is a standalone change management system with no opinions about your database engine, application framework, or development environment.

Native scripting
Changes are implemented as scripts native to your selected database engine. Writing a PostgreSQL application? Write SQL scripts for psql. Writing a MySQL-backed app? Write SQL scripts for mysql.

Dependency resolution
Database changes may declare dependencies on other changes—even on changes from other Sqitch projects. This ensures proper order of execution, even when you’ve committed changes to your VCS out-of-order.

No numbering
Change deployment is managed by maintaining a plan file. As such, there is no need to number your changes, although you can if you want. Sqitch doesn’t much care how you name your changes.

Iterative development
Up until you tag and release your application, you can modify your change deployment scripts as often as you like. They’re not locked in just because they’ve been committed to your VCS. This allows you to take an iterative approach to developing your database schema. Or, better, you can do test-driven database development.

46 questions
7
votes
1 answer

Altering Table with Sqitch Rework command

I've tried several times to follow Sqitch's 'postgres tutorial', just except instead of altering a function (which uses CREATE OR REPLACE FUNCTION), I'm changing a field name in a table to see how it'll workout after a deployment. But it ends up…
Da CodeKid
  • 723
  • 10
  • 12
5
votes
0 answers

What's the point of dependencies in sqitch?

Since order of changes can also be parsed from the plan, how does specifying dependencies make a difference? Also, do I need to specify all dependencies, or only the last change from each dependency chain?
anukul
  • 1,922
  • 1
  • 19
  • 37
4
votes
0 answers

Is it possible to write a Sqitch change that drops a column, without dooming sqitch verify to forevermore fail?

This question is specific to Sqitch, but may have relevance with other database migration management tools. The first Sqitch change in my application defines its general schema: it creates all my tables tables and defines their columns. Let's say…
Jacob Ford
  • 4,553
  • 5
  • 27
  • 42
4
votes
1 answer

Reverting a specific change with sqitch?

Is it possible to revert a specific change if there are no dependencies in sqitch? For example, I set up my project like the code below and deploy it and load some data. A day or so later (or perhaps the same day), a stakeholder decides that I need…
ldacey
  • 518
  • 8
  • 16
3
votes
1 answer

Verify table does NOT exist with mysql query in sqitch

I'm using sqitch to track database changes, and one of the ways it works is to verify changes with a sql query. If the query returns an error then the change is considered unsuccessful. I have a change where I am permanently dropping a table from my…
Slotheroo
  • 925
  • 2
  • 9
  • 17
2
votes
1 answer

How can I add a custom variable to Sqitch, to be used in target postgres

I would like to add few variables:"username' and "database" in my sqitch.conf on a defined target. file sqitch.conf=> engine = pg [core "variables"] username = jv_root database = test [target "dev_1"] uri =…
Mai Same
  • 21
  • 1
2
votes
2 answers

How can I verify an alter column data type change with sqitch postgresql?

I am making the following deploy change. Changing the value of a timestamp column to timestamptz. -- Alter the is_deleted flags to be timestamp with time zone alter table source_meta.sources alter column is_deleted set data type timestamptz …
nackjicholson
  • 4,557
  • 4
  • 37
  • 35
2
votes
2 answers

Whats meaning of where false; in SQL query

I came across one SQL query in sqitch db schema management tool which is as follows: BEGIN; select subject , comment , timestamp from tutorial.video where false; ROLLBACK; Above query is part of verify strategy; What is interpretation or…
Pramod S. Nikam
  • 4,271
  • 4
  • 38
  • 62
2
votes
2 answers

Install Sqitch Perl CPAN module on Windows

I'm trying to install sqitch on Windows 10 after installing it with CPAN using latest Strawberry Perl. cat NEWS >ReleaseNotes 'cat' is not recognized as an internal or external command, operable program or batch file. dmake.exe: Error code 129,…
Cortlendt
  • 2,190
  • 4
  • 29
  • 50
2
votes
1 answer

How to copy function in PostgreSQL

I want to write sqitch deploy script to create new version of trigger. To ensure that revert script will revert function to previous version, I'd like to make a backup of this function. Is there any way to copy (RENAME TO is not working!) trigger…
Jarek
  • 329
  • 2
  • 13
2
votes
1 answer

Sqitch throws fe_sendauth (no password) error with sqitch

I am trying to use PostgREST and sqitch on Debian (Wheezy) to provide a REST API for an Android app which queries a Postgres DB, like in this example. I've written SQL to create the tables, however when I issue the sqitch deploy command (as in the…
Hack-R
  • 22,422
  • 14
  • 75
  • 131
1
vote
2 answers

Sqitch - single plan row, multiple sql files

I'm looking to move to sqitch, but my team likes their migrations as multiple files. That is, for example, if we create a foreign key and create an index in the same jira ticket, we like PROJ-123-create-fk.sql and PROJ-123-create-index.sql. I'd like…
Hoopes
  • 3,943
  • 4
  • 44
  • 60
1
vote
1 answer

Is there a way to remove a migration added to sqitch?

In sqitch there is the ADD command to add a new migration. Is there any command to remove that ADDITION?
xavi12p
  • 11
  • 1
1
vote
1 answer

Baseline existing database

Im looking at Sqitch and so far it seems like a great tool, however I have an existing project that I want to use it with, Is there a way to create a baseline? For example, I take a backup of my schema then add it to the deploy script, I then want…
Steven Marks
  • 704
  • 1
  • 6
  • 21
1
vote
1 answer

Sqitch cannot connect to a running Postgres instance

I have a Postgres 9.6 instance on OSX that is up and running, but Sqitch throws the following error when I try sqitch status in a working directory with a sqitch.conf: $ sqitch status # On database db:pg:my_db could not connect to server: No such…
J-Deq87
  • 101
  • 10
1
2 3 4