.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "sqitchtutorial-sqlite 3pm" .TH sqitchtutorial-sqlite 3pm 2024-02-08 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH Name .IX Header "Name" sqitchtutorial-sqlite \- A tutorial introduction to Sqitch change management on SQLite .SH Synopsis .IX Header "Synopsis" .Vb 1 \& sqitch * .Ve .SH Description .IX Header "Description" This tutorial explains how to create a sqitch-enabled SQLite project, use a VCS for deployment planning, and work with other developers to make sure changes remain in sync and in the proper order. .PP We'll start by creating new project from scratch, a fictional antisocial networking site called Flipr. All examples use Git as the VCS and SQLite as the storage engine. .PP If you'd like to manage a PostgreSQL database, see sqitchtutorial. .PP If you'd like to manage an Oracle database, see sqitchtutorial-oracle. .PP If you'd like to manage a MySQL database, see sqitchtutorial-mysql. .PP If you'd like to manage a Firebird database, see sqitchtutorial-firebird. .PP If you'd like to manage a Vertica database, see sqitchtutorial-vertica. .PP If you'd like to manage an Exasol database, see sqitchtutorial-exasol. .PP If you'd like to manage a Snowflake database, see sqitchtutorial-snowflake. .SH "Starting a New Project" .IX Header "Starting a New Project" Usually the first thing to do when starting a new project is to create a source code repository. So let's do that with Git: .PP .Vb 10 \& > mkdir flipr \& > cd flipr \& > git init . \& Initialized empty Git repository in /flipr/.git/ \& > touch README.md \& > git add . \& > git commit \-m \*(AqInitialize project, add README.\*(Aq \& [main (root\-commit) 253542e] Initialize project, add README. \& 1 file changed, 37 insertions(+) \& create mode 100644 README.md .Ve .PP If you're a Git user and want to follow along the history, the repository used in these examples is on GitHub . .PP Now that we have a repository, let's get started with Sqitch. Every Sqitch project must have a name associated with it, and, optionally, a unique URI. We recommend including the URI, as it increases the uniqueness of object identifiers internally, and will prevent the deployment of a different project with the same name. So let's specify one when we initialize Sqitch: .PP .Vb 6 \& > sqitch init flipr \-\-uri https://github.com/sqitchers/sqitch\-sqlite\-intro/ \-\-engine sqlite \& Created sqitch.conf \& Created sqitch.plan \& Created deploy/ \& Created revert/ \& Created verify/ .Ve .PP Let's have a look at \fIsqitch.conf\fR: .PP .Vb 9 \& > cat sqitch.conf \& [core] \& engine = sqlite \& # plan_file = sqitch.plan \& # top_dir = . \& # [engine "sqlite"] \& # target = db:sqlite: \& # registry = sqitch \& # client = sqlite3 .Ve .PP Good, it picked up on the fact that we're creating changes for the SQLite engine, thanks to the \f(CW\*(C`\-\-engine sqlite\*(C'\fR option, and saved it to the file. Furthermore, it wrote a commented-out \f(CW\*(C`[engine "sqlite"]\*(C'\fR section with all the available SQLite engine-specific settings commented out and ready to be edited as appropriate. .PP By default, Sqitch will read \fIsqitch.conf\fR in the current directory for settings. But it will also read \fI~/.sqitch/sqitch.conf\fR for user-specific settings. Since SQLite's \f(CW\*(C`sqlite3\*(C'\fR client is not in the path on my system, let's go ahead an tell it where to find the client on our computer (don't bother if you're using the Docker image because it uses the client inside the container, not on your host machine). .PP .Vb 1 \& > sqitch config \-\-user engine.sqlite.client /opt/local/bin/sqlite3 .Ve .PP And let's also tell it who we are, since this data will be used in all of our projects: .PP .Vb 2 \& > sqitch config \-\-user user.name \*(AqMarge N. O’Vera\*(Aq \& > sqitch config \-\-user user.email \*(Aqmarge@example.com\*(Aq .Ve .PP Have a look at \fI~/.sqitch/sqitch.conf\fR and you'll see this: .PP .Vb 6 \& > cat ~/.sqitch/sqitch.conf \& [engine "sqlite"] \& client = /opt/local/bin/sqlite3 \& [user] \& name = Marge N. O’Vera \& email = marge@example.com .Ve .PP Which means that Sqitch should be able to find \f(CW\*(C`sqlite3\*(C'\fR for any project, and that it will always properly identify us when planning and committing changes. .PP Back to the repository. Have a look at the plan file, \fIsqitch.plan\fR: .PP .Vb 4 \& > cat sqitch.plan \& %syntax\-version=1.0.0 \& %project=flipr \& %uri=https://github.com/sqitchers/sqitch\-sqlite\-intro/ .Ve .PP Note that it has picked up on the name and URI of the app we're building. Sqitch uses this data to manage cross-project dependencies. The \&\f(CW\*(C`%syntax\-version\*(C'\fR pragma is always set by Sqitch, so that it always knows how to parse the plan, even if the format changes in the future. .PP Let's commit these changes and start creating the database changes. .PP .Vb 6 \& > git add . \& > git commit \-m \*(AqInitialize Sqitch configuration.\*(Aq \& [main 91e2f0d] Initialize Sqitch configuration. \& 2 files changed, 19 insertions(+) \& create mode 100644 sqitch.conf \& create mode 100644 sqitch.plan .Ve .SH "Our First Change" .IX Header "Our First Change" Let's create a table. Our app will need users, of course, so we'll create a table for them. Run this command: .PP .Vb 5 \& > sqitch add users \-n \*(AqCreates table to track our users.\*(Aq \& Created deploy/users.sql \& Created revert/users.sql \& Created verify/users.sql \& Added "users" to sqitch.plan .Ve .PP The \f(CW\*(C`add\*(C'\fR command adds a database change to the plan and writes deploy, revert, and verify scripts that represent the change. Now we edit these files. The \f(CW\*(C`deploy\*(C'\fR script's job is to create the table. By default, the \fIdeploy/users.sql\fR file looks like this: .PP .Vb 1 \& \-\- Deploy flipr:users to sqlite \& \& BEGIN; \& \& \-\- XXX Add DDLs here. \& \& COMMIT; .Ve .PP What we want to do is to replace the \f(CW\*(C`XXX\*(C'\fR comment with the \f(CW\*(C`CREATE TABLE\*(C'\fR statement, like so: .PP .Vb 1 \& \-\- Deploy flipr:users to sqlite \& \& BEGIN; \& \& CREATE TABLE users ( \& nickname TEXT PRIMARY KEY, \& password TEXT NOT NULL, \& fullname TEXT NOT NULL, \& twitter TEXT NOT NULL, \& timestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP \& ); \& \& COMMIT; .Ve .PP The \f(CW\*(C`revert\*(C'\fR script's job is to precisely revert the change to the deploy script, so we edit this to \fIrevert/users.sql\fR to look like this: .PP .Vb 1 \& \-\- Revert flipr:users from sqlite \& \& BEGIN; \& \& DROP TABLE users; \& \& COMMIT; .Ve .PP Now we can try deploying this change. We tell Sqitch where to send the change via a database URI . Here we've specified a database file, \fIflipr_test.db\fR: .PP .Vb 4 \& > sqitch deploy db:sqlite:flipr_test.db \& Adding registry tables to db:sqlite:sqitch.db \& Deploying changes to db:sqlite:flipr_test.db \& + users .. ok .Ve .PP First Sqitch created the registry database and tables used to track database changes. The registry is separate from the database to which the \f(CW\*(C`users\*(C'\fR change was deployed; by default, its name is \f(CW\*(C`sqitch.$suffix\*(C'\fR, where \&\f(CW$suffix\fR is the same as the suffix on the target database, if any. It lives in the same directory as the target database. This will be useful if you use the SQLite \f(CW\*(C`ATTACHDATABASE\*(C'\fR command to manage multiple database files in a single project. In that case, you will want to use the same file for all the databases. Keep them all in the same directory with the same suffix and you get just that with the default sqitch database. In this case, we should end up with two databases: .IP \(bu 4 \&\fIsqitch.db\fR .Sp The Sqitch registry database. .IP \(bu 4 \&\fIflipr_test.db\fR .Sp The database Sqitch manages. .PP If you'd like it to have a different name for the registry database, use \&\f(CW\*(C`sqitch engine add sqlite $name\*(C'\fR to configure it (or via the \&\f(CW\*(C`target\*(C'\fR command; more below). This will be useful if you don't want to use the same registry database to manage multiple databases, or if you do, but they live in different directories. .PP Next, Sqitch deploys changes to the target database, which we specified on the command-line. We only have one so far; the \f(CW\*(C`+\*(C'\fR reinforces the idea that the change is being \fIadded\fR to the database. .PP With this change deployed, if you connect to the database, you'll be able to see the schema: .PP .Vb 2 \& > sqlite3 flipr_test.db \*(Aq.tables\*(Aq \& users .Ve .SS "Trust, But Verify" .IX Subsection "Trust, But Verify" But that's too much work. do you really want to do something like that after every deploy? .PP Here's where the \f(CW\*(C`verify\*(C'\fR script comes in. Its job is to test that the deploy did was it was supposed to. It should do so without regard to any data that might be in the database, and should throw an error if the deploy was not successful. The easiest way to do that with a table is to simply \f(CW\*(C`SELECT\*(C'\fR from it. Put this query into \fIverify/users.sql\fR: .PP .Vb 3 \& SELECT nickname, password, fullname, twitter \& FROM users \& WHERE 0; .Ve .PP Now you can run the \f(CW\*(C`verify\*(C'\fR script with the \f(CW\*(C`verify\*(C'\fR command: .PP .Vb 4 \& > sqitch verify db:sqlite:flipr_test.db \& Verifying db:sqlite:flipr_test.db \& * users .. ok \& Verify successful .Ve .PP Looks good! If you want to make sure that the verify script correctly dies if the table doesn't exist, temporarily change the table name in the script to something that doesn't exist, something like: .PP .Vb 3 \& SELECT nickname, password, timestamp \& FROM users_nonesuch \& WHERE 0; .Ve .PP Then \f(CW\*(C`verify\*(C'\fR again: .PP .Vb 5 \& > sqitch verify db:sqlite:flipr_test.db \& Verifying db:sqlite:flipr_test.db \& * users .. Error: near line 5: no such table: users_nonesuch \& # Verify script "verify/users.sql" failed. \& not ok \& \& Verify Summary Report \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& Changes: 1 \& Errors: 1 \& Verify failed .Ve .PP SQLite is kind enough to tell us what the problem is. Don't forget to change the table name back before continuing! .SS "Status, Revert, Log, Repeat" .IX Subsection "Status, Revert, Log, Repeat" For purely informational purposes, we can always see how a deployment was recorded via the \f(CW\*(C`status\*(C'\fR command, which reads the tables from the registry database: .PP .Vb 9 \& > sqitch status db:sqlite:flipr_test.db \& # On database db:sqlite:flipr_test.db \& # Project: flipr \& # Change: f30fe47f5f99501fb8d481e910d9112c5ac0a676 \& # Name: users \& # Deployed: 2013\-12\-31 10:26:59 \-0800 \& # By: Marge N. O’Vera \& # \& Nothing to deploy (up\-to\-date) .Ve .PP Let's make sure that we can revert the change: .PP .Vb 3 \& > sqitch revert db:sqlite:flipr_test.db \& Revert all changes from db:sqlite:flipr_test.db? [Yes] \& \- users .. ok .Ve .PP The \f(CW\*(C`revert\*(C'\fR command first prompts to make sure that we really do want to revert. This is to prevent unnecessary accidents. You can pass the \f(CW\*(C`\-y\*(C'\fR option to disable the prompt. Also, notice the \f(CW\*(C`\-\*(C'\fR before the change name in the output, which reinforces that the change is being \&\fIremoved\fR from the database. And now the schema should be gone: .PP .Vb 1 \& > sqlite3 flipr_test.db \*(Aq.tables\*(Aq .Ve .PP And the status message should reflect as much: .PP .Vb 3 \& > sqitch status db:sqlite:flipr_test.db \& # On database db:sqlite:flipr_test.db \& No changes deployed .Ve .PP Of course, since nothing is deployed, the \f(CW\*(C`verify\*(C'\fR command has nothing to verify: .PP .Vb 3 \& > sqitch verify db:sqlite:flipr_test.db \& Verifying db:sqlite:flipr_test.db \& No changes deployed .Ve .PP However, we still have a record that the change happened, visible via the \&\f(CW\*(C`log\*(C'\fR command: .PP .Vb 6 \& > sqitch log db:sqlite:flipr_test.db \& On database db:sqlite:flipr_test.db \& Revert f30fe47f5f99501fb8d481e910d9112c5ac0a676 \& Name: users \& Committer: Marge N. O’Vera \& Date: 2013\-12\-31 10:53:25 \-0800 \& \& Creates table to track our users. \& \& Deploy f30fe47f5f99501fb8d481e910d9112c5ac0a676 \& Name: users \& Committer: Marge N. O’Vera \& Date: 2013\-12\-31 10:26:59 \-0800 \& \& Creates table to track our users. .Ve .PP Note that the actions we took are shown in reverse chronological order, with the revert first and then the deploy. .PP Cool. Let's tell Git to ignore \fI*.db\fR files and then commit it. .PP .Vb 9 \& > echo \*(Aq*.db\*(Aq > .gitignore \& > git add . \& > git commit \-m \*(AqAdd users table.\*(Aq \& [main 6725454] Add users table. \& 5 files changed, 31 insertions(+) \& create mode 100644 .gitignore \& create mode 100644 deploy/users.sql \& create mode 100644 revert/users.sql \& create mode 100644 verify/users.sql .Ve .PP And then deploy again. This time, let's use the \f(CW\*(C`\-\-verify\*(C'\fR option, so that the \f(CW\*(C`verify\*(C'\fR script is applied when the change is deployed: .PP .Vb 3 \& > sqitch deploy db:sqlite:flipr_test.db \-\-verify \& Deploying changes to db:sqlite:flipr_test.db \& + users .. ok .Ve .PP And now the \f(CW\*(C`users\*(C'\fR table should be back: .PP .Vb 2 \& > sqlite3 flipr_test.db \*(Aq.tables\*(Aq \& users .Ve .PP When we look at the status, the deployment will be there: .PP .Vb 9 \& > sqitch status db:sqlite:flipr_test.db \& # On database db:sqlite:flipr_test.db \& # Project: flipr \& # Change: f30fe47f5f99501fb8d481e910d9112c5ac0a676 \& # Name: users \& # Deployed: 2013\-12\-31 10:57:55 \-0800 \& # By: Marge N. O’Vera \& # \& Nothing to deploy (up\-to\-date) .Ve .SH "On Target" .IX Header "On Target" I'm getting a little tired of always having to type \&\f(CW\*(C`db:sqlite:flipr_test.db\*(C'\fR, aren't you? This database connection URI tells Sqitch how to connect to the deployment target, but we don't have to keep using the URI. We can name the target: .PP .Vb 1 \& > sqitch target add flipr_test db:sqlite:flipr_test.db .Ve .PP The \f(CW\*(C`target\*(C'\fR command, inspired by \&\f(CW\*(C`git\-remote\*(C'\fR , allows management of one or more named deployment targets. We've just added a target named \&\f(CW\*(C`flipr_test\*(C'\fR, which means we can use the string \f(CW\*(C`flipr_test\*(C'\fR for the target, rather than the URI. But since we're doing so much testing, we can also tell Sqitch to deploy to the \f(CW\*(C`flipr_test\*(C'\fR target by default: .PP .Vb 1 \& > sqitch engine add sqlite flipr_test .Ve .PP Now we can omit the target argument altogether, unless we need to deploy to another database. Which we will, eventually, but at least our examples will be simpler from here on in, e.g.: .PP .Vb 9 \& > sqitch status \& # On database flipr_test \& # Project: flipr \& # Change: f30fe47f5f99501fb8d481e910d9112c5ac0a676 \& # Name: users \& # Deployed: 2013\-12\-31 10:57:55 \-0800 \& # By: Marge N. O’Vera \& # \& Nothing to deploy (up\-to\-date) .Ve .PP Yay, that allows things to be a little more concise. Let's also make sure that changes are verified after deploying them: .PP .Vb 2 \& > sqitch config \-\-bool deploy.verify true \& > sqitch config \-\-bool rebase.verify true .Ve .PP We'll see the \f(CW\*(C`rebase\*(C'\fR command a bit later. In the meantime, let's commit the new configuration and and make some more changes! .PP .Vb 3 \& > git commit \-am \*(AqSet default target and always verify.\*(Aq \& [main 5fb57ec] Set default target and always verify. \& 1 file changed, 8 insertions(+) .Ve .SH "Deploy with Dependency" .IX Header "Deploy with Dependency" Let's add another change. Our app will need to store status messages from users. Let's call them \-\- and the table to store them \-\- "flips". First, add the new change: .PP .Vb 5 \& > sqitch add flips \-\-requires users \-n \*(AqAdds table for storing flips.\*(Aq \& Created deploy/flips.sql \& Created revert/flips.sql \& Created verify/flips.sql \& Added "flips [users]" to sqitch.plan .Ve .PP Note that we're requiring the \f(CW\*(C`users\*(C'\fR change as a dependency of the new \&\f(CW\*(C`flips\*(C'\fR change. Although that change has already been added to the plan and therefore should always be applied before the \f(CW\*(C`flips\*(C'\fR change, it's a good idea to be explicit about dependencies. .PP Now edit the scripts. When you're done, \fIdeploy/flips.sql\fR should look like this: .PP .Vb 2 \& \-\- Deploy flipr:flips to sqlite \& \-\- requires: users \& \& BEGIN; \& \& CREATE TABLE flips ( \& id INTEGER PRIMARY KEY AUTOINCREMENT, \& nickname TEXT NOT NULL REFERENCES users(nickname), \& body TEXT NOT NULL DEFAULT \*(Aq\*(Aq CHECK ( length(body) <= 180 ), \& timestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP \& ); \& \& COMMIT; .Ve .PP A couple things to notice here. On the second line, the dependence on the \&\f(CW\*(C`users\*(C'\fR change has been listed. This doesn't do anything, but the default \&\f(CW\*(C`deploy\*(C'\fR template lists it here for your reference while editing the file. Useful, right? .PP The \f(CW\*(C`users.nickname\*(C'\fR column references the \f(CW\*(C`users\*(C'\fR table. This is why we need to require the \f(CW\*(C`users\*(C'\fR change. .PP Now for the verify script. Again, all we need to do is \f(CW\*(C`SELECT\*(C'\fR from the table. I recommend selecting each column by name, too, to be sure that no column is missing. Here's the \fIverify/flips.sql\fR: .PP .Vb 1 \& \-\- Verify flipr:flips on sqlite \& \& BEGIN; \& \& SELECT id, nickname, body, timestamp \& FROM flips \& WHERE 0; \& \& ROLLBACK; .Ve .PP Now for the revert script: all we have to do is drop the table. Add this to \&\fIrevert/flips.sql\fR: .PP .Vb 1 \& \-\- Revert flipr:flips from sqlite \& \& BEGIN; \& \& DROP TABLE flips; \& \& COMMIT; .Ve .PP Couldn't be much simpler, right? Let's deploy this bad boy: .PP .Vb 3 \& > sqitch deploy \& Deploying changes to flipr_test \& + flips .. ok .Ve .PP We know, since verification is enabled, that the table must have been created. But for the purposes of visibility, let's have a quick look: .PP .Vb 2 \& > sqlite3 flipr_test.db \*(Aq.tables\*(Aq \& flips users .Ve .PP We can also verify all currently deployed changes with the \&\f(CW\*(C`verify\*(C'\fR command: .PP .Vb 5 \& > sqitch verify \& Verifying flipr_test \& * users .. ok \& * flips .. ok \& Verify successful .Ve .PP Now have a look at the status: .PP .Vb 9 \& > sqitch status \& # On database flipr_test \& # Project: flipr \& # Change: 32ee57069c0d7fec52b6f86f453dc0c16bc1090a \& # Name: flips \& # Deployed: 2013\-12\-31 11:02:51 \-0800 \& # By: Marge N. O’Vera \& # \& Nothing to deploy (up\-to\-date) .Ve .PP Success! Let's make sure we can revert the change, as well: .PP .Vb 3 \& > sqitch revert \-\-to @HEAD^ \-y \& Reverting changes to users from flipr_test \& \- flips .. ok .Ve .PP Note that we've used the \f(CW\*(C`\-\-to\*(C'\fR option to specify the change to revert to. And what do we revert to? The symbolic tag \f(CW@HEAD\fR, when passed to \&\f(CW\*(C`revert\*(C'\fR, always refers to the last change deployed to the database. (For other commands, it refers to the last change in the plan.) Appending the caret (\f(CW\*(C`^\*(C'\fR) tells Sqitch to select the change \fIprior\fR to the last deployed change. So we revert to \f(CW\*(C`users\*(C'\fR, the penultimate change. The other potentially useful symbolic tag is \f(CW@ROOT\fR, which refers to the first change deployed to the database (or in the plan, depending on the command). .PP Back to the database. The \f(CW\*(C`flips\*(C'\fR table should be gone but the \f(CW\*(C`users\*(C'\fR table should still be around: .PP .Vb 2 \& > sqlite3 flipr_test.db \*(Aq.tables\*(Aq \& users .Ve .PP The \f(CW\*(C`status\*(C'\fR command politely informs us that we have undeployed changes: .PP .Vb 10 \& > sqitch status \& # On database flipr_test \& # Project: flipr \& # Change: f30fe47f5f99501fb8d481e910d9112c5ac0a676 \& # Name: users \& # Deployed: 2013\-12\-31 10:57:55 \-0800 \& # By: Marge N. O’Vera \& # \& Undeployed change: \& * flips .Ve .PP As does the \f(CW\*(C`verify\*(C'\fR command: .PP .Vb 6 \& > sqitch verify \& Verifying flipr_test \& * users .. ok \& Undeployed change: \& * flips \& Verify successful .Ve .PP Note that the verify is successful, because all currently-deployed changes are verified. The list of undeployed changes (just "flips" here) reminds us about the current state. .PP Okay, let's commit and deploy again: .PP .Vb 10 \& > git add . \& > git commit \-am \*(AqAdd flips table.\*(Aq \& [main 21cba95] Add flips table. \& 4 files changed, 30 insertions(+) \& create mode 100644 deploy/flips.sql \& create mode 100644 revert/flips.sql \& create mode 100644 verify/flips.sql \& > sqitch deploy \& Deploying changes to flipr_test \& + flips .. ok .Ve .PP Looks good. Check the status: .PP .Vb 9 \& > sqitch status \& # On database flipr_test \& # Project: flipr \& # Change: 32ee57069c0d7fec52b6f86f453dc0c16bc1090a \& # Name: flips \& # Deployed: 2013\-12\-31 11:05:44 \-0800 \& # By: Marge N. O’Vera \& # \& Nothing to deploy (up\-to\-date) .Ve .SH "View to a Thrill" .IX Header "View to a Thrill" One more thing to add before we are ready to ship a first beta release. Let's create a view that lists user names with their flips. .PP .Vb 6 \& > sqitch add userflips \-\-requires users \-\-requires flips \e \& \-n \*(AqCreates the userflips view.\*(Aq \& Created deploy/userflips.sql \& Created revert/userflips.sql \& Created verify/userflips.sql \& Added "userflips [users flips]" to sqitch.plan .Ve .PP Now add this SQL to \fIdeploy/userflips.sql\fR: .PP .Vb 4 \& CREATE VIEW userflips AS \& SELECT f.id, u.nickname, u.fullname, f.body, f.timestamp \& FROM users u \& JOIN flips f ON u.nickname = f.nickname; .Ve .PP Add this SQL to \fIverify/userflips.sql\fR .PP .Vb 3 \& SELECT id, nickname, fullname, body, timestamp \& FROM userflips \& WHERE 0; .Ve .PP And add the \f(CW\*(C`DROP VIEW\*(C'\fR statement to \fIrevert/userflips.sql\fR: .PP .Vb 1 \& DROP VIEW userflips; .Ve .PP Now Try it out! .PP .Vb 10 \& > sqitch deploy \& Deploying changes to flipr_test \& + userflips .. ok \& > sqitch revert \-y \& Reverting all changes from flipr_test \& \- userflips .. ok \& \- flips ...... ok \& \- users ...... ok \& > sqitch deploy \& Deploying changes to flipr_test \& + users ...... ok \& + flips ...... ok \& + userflips .. ok .Ve .PP Looks good! Commit it. .PP .Vb 7 \& > git add . \& > git commit \-m \*(AqAdd the userflips view.\*(Aq \& [main c74bfb4] Add the userflips view. \& 4 files changed, 29 insertions(+) \& create mode 100644 deploy/userflips.sql \& create mode 100644 revert/userflips.sql \& create mode 100644 verify/userflips.sql .Ve .SH "Ship It!" .IX Header "Ship It!" Now we're ready for the first development release of our app. Let's call it \&\f(CW\*(C`1.0.0\-dev1\*(C'\fR Since we want to have it go out with deployments tied to the release, let's tag it: .PP .Vb 6 \& > sqitch tag v1.0.0\-dev1 \-n \*(AqTag v1.0.0\-dev1.\*(Aq \& Tagged "userflips" with @v1.0.0\-dev1 \& > git commit \-am \*(AqTag the database with v1.0.0\-dev1.\*(Aq \& [main 7a479fd] Tag the database with v1.0.0\-dev1. \& 1 file changed, 1 insertion(+) \& > git tag v1.0.0\-dev1 \-am \*(AqTag v1.0.0\-dev1\*(Aq .Ve .PP We can try deploying to make sure the tag gets picked up like so: .PP .Vb 6 \& > mkdir dev \& > sqitch deploy db:sqlite:dev/flipr.db \& Adding registry tables to db:sqlite:dev/sqitch.db \& Deploying changes to db:sqlite:dev/flipr.db \& + users ................... ok \& + flips ................... ok .Ve .PP Great, both changes were deployed and \f(CW\*(C`userflips\*(C'\fR was tagged with \&\f(CW\*(C`@v1.0.0\-dev1\*(C'\fR. Let's have a look at the status: .PP .Vb 10 \& > sqitch status db:sqlite:dev/flipr_dev.db \& # On database db:sqlite:dev/flipr_dev.db \& # Project: flipr \& # Change: 60ee3aba0445bf3287f9dc1dd97b1877523fa139 \& # Name: userflips \& # Tag: @v1.0.0\-dev1 \& # Deployed: 2013\-12\-31 11:19:15 \-0800 \& # By: Marge N. O’Vera \& # \& Nothing to deploy (up\-to\-date) .Ve .PP Note the listing of the tag as part of the status message. Now let's bundle everything up for release: .PP .Vb 9 \& > rm \-rf dev \& > sqitch bundle \& Bundling into bundle \& Writing config \& Writing plan \& Writing scripts \& + users \& + flips \& + userflips @v1.0.0\-dev1 .Ve .PP Now we can package the \fIbundle\fR directory and distribute it. When it gets installed somewhere, users can use Sqitch to deploy to the database. Let's try deploying it: .PP .Vb 7 \& > cd bundle \& > sqitch deploy db:sqlite:flipr_prod.db \& Adding registry tables to db:sqlite:sqitch.db \& Deploying changes to db:sqlite:flipr_prod.db \& + users ................... ok \& + flips ................... ok \& + userflips @v1.0.0\-dev1 .. ok .Ve .PP Looks much the same as before, eh? Package it up and ship it! .PP .Vb 4 \& > rm *.db \& > cd .. \& > mv bundle flipr\-v1.0.0\-dev1 \& > tar \-czf flipr\-v1.0.0\-dev1.tgz flipr\-v1.0.0\-dev1 .Ve .SH "Making a Hash of Things" .IX Header "Making a Hash of Things" Now that we've got the basics of the app done, let's add a feature. Gotta track the hashtags associated with flips, right? Let's add a table for them. But since other folks are working on other tasks in the repository, we'll work on a branch, so we can all stay out of each other's way. So let's branch: .PP .Vb 2 \& > git checkout \-b hashtags \& Switched to a new branch \*(Aqhashtags\*(Aq .Ve .PP Now we can add a new change to create a table for hashtags. .PP .Vb 5 \& > sqitch add hashtags \-\-requires flips \-n \*(AqAdds table for storing hashtags.\*(Aq \& Created deploy/hashtags.sql \& Created revert/hashtags.sql \& Created verify/hashtags.sql \& Added "hashtags [flips]" to sqitch.plan .Ve .PP You know the drill by now. Add this to \fIdeploy/hashtags.sql\fR .PP .Vb 5 \& CREATE TABLE hashtags ( \& flip_id INTEGER NOT NULL REFERENCES flips(id), \& hashtag TEXT NOT NULL CHECK ( length(hashtag) > 0 ), \& PRIMARY KEY (flip_id, hashtag) \& ); .Ve .PP Again, select from the table in \fIverify/hashtags.sql\fR: .PP .Vb 1 \& SELECT flip_id, hashtag FROM hashtags WHERE 0; .Ve .PP And drop it in \fIrevert/hashtags.sql\fR .PP .Vb 1 \& DROP TABLE hashtags; .Ve .PP And give it a whirl: .PP .Vb 3 \& > sqitch deploy \& Deploying changes to flipr_test \& + hashtags .. ok .Ve .PP Look good? .PP .Vb 12 \& > sqitch status \-\-show\-tags \& # On database flipr_test \& # Project: flipr \& # Change: 1352464e8b5f3d5eeac76a1986379f07de43bffd \& # Name: hashtags \& # Deployed: 2013\-12\-31 11:30:53 \-0800 \& # By: Marge N. O’Vera \& # \& # Tag: \& # @v1.0.0\-dev1 \- 2013\-12\-31 11:13:49 \-0800 \- Marge N. O’Vera \& # \& Nothing to deploy (up\-to\-date) .Ve .PP Note the use of \f(CW\*(C`\-\-show\-tags\*(C'\fR to show all the deployed tags. Make sure we can revert, too: .PP .Vb 6 \& > sqitch revert \-\-to @HEAD^ \-y \& Reverting changes to userflips @v1.0.0\-dev1 from flipr_test \& \- hashtags .. ok \& > sqitch deploy \& Deploying changes to flipr_test \& + hashtags .. ok .Ve .PP Great! Now make it so: .PP .Vb 7 \& > git add . \& > git commit \-m \*(AqAdd hashtags table.\*(Aq \& [hashtags 94f02b8] Add hashtags table. \& 4 files changed, 28 insertions(+) \& create mode 100644 deploy/hashtags.sql \& create mode 100644 revert/hashtags.sql \& create mode 100644 verify/hashtags.sql .Ve .PP Good, we've finished this feature. Time to merge back into \f(CW\*(C`main\*(C'\fR. .SS Emergency .IX Subsection "Emergency" Let's do it: .PP .Vb 10 \& > git checkout main \& Switched to branch \*(Aqmain\*(Aq \& > git pull \& Updating 7a479fd..47a4107 \& Fast\-forward \& deploy/lists.sql | 13 +++++++++++++ \& revert/lists.sql | 7 +++++++ \& sqitch.plan | 2 ++ \& verify/lists.sql | 9 +++++++++ \& 4 files changed, 31 insertions(+) \& create mode 100644 deploy/lists.sql \& create mode 100644 revert/lists.sql \& create mode 100644 verify/lists.sql .Ve .PP Hrm, that's interesting. Looks like someone made some changes to \f(CW\*(C`main\*(C'\fR. They added list support. Well, let's see what happens when we merge our changes. .PP .Vb 4 \& > git merge \-\-no\-ff hashtags \& Auto\-merging sqitch.plan \& CONFLICT (content): Merge conflict in sqitch.plan \& Automatic merge failed; fix conflicts and then commit the result. .Ve .PP Oh, a conflict in \fIsqitch.plan\fR. Not too surprising, since both the merged \&\f(CW\*(C`lists\*(C'\fR branch and our \f(CW\*(C`hashtags\*(C'\fR branch added changes to the plan. Let's try a different approach. .PP The truth is, we got lazy. Those changes when we pulled main from the origin should have raised a red flag. It's considered a bad practice not to look at what's changed in \f(CW\*(C`main\*(C'\fR before merging in a branch. What one \fIshould\fR do is either: .IP \(bu 4 Rebase the \fIhashtags\fR branch from main before merging. This "rewinds" the branch changes, pulls from \f(CW\*(C`main\*(C'\fR, and then replays the changes back on top of the pulled changes. .IP \(bu 4 Create a patch and apply \fIthat\fR to main. This is the sort of thing you might have to do if you're sending changes to another user, especially if the VCS is not Git. .PP So let's restore things to how they were at main: .PP .Vb 2 \& > git reset \-\-hard HEAD \& HEAD is now at 47a4107 Merge branch \*(Aqlists\*(Aq .Ve .PP That throws out our botched merge. Now let's go back to our branch and rebase it on \f(CW\*(C`main\*(C'\fR: .PP .Vb 10 \& > git checkout hashtags \& Switched to branch \*(Aqhashtags\*(Aq \& > git rebase main \& First, rewinding head to replay your work on top of it... \& Applying: Add hashtags table. \& Using index info to reconstruct a base tree... \& M sqitch.plan \& Falling back to patching base and 3\-way merge... \& Auto\-merging sqitch.plan \& CONFLICT (content): Merge conflict in sqitch.plan \& Failed to merge in the changes. \& Patch failed at 0001 Add hashtags table. \& The copy of the patch that failed is found in: \& .git/rebase\-apply/patch \& \& When you have resolved this problem, run "git rebase \-\-continue". \& If you prefer to skip this patch, run "git rebase \-\-skip" instead. \& To check out the original branch and stop rebasing, run "git rebase \-\-abort". .Ve .PP Oy, that's kind of a pain. It seems like no matter what we do, we'll need to resolve conflicts in that file. Except in Git. Fortunately for us, we can tell Git to resolve conflicts in \fIsqitch.plan\fR differently. Because we only ever append lines to the file, we can have it use the "union" merge driver, which, according to its docs : .Sp .RS 4 Run 3\-way file level merge for text files, but take lines from both versions, instead of leaving conflict markers. This tends to leave the added lines in the resulting file in random order and the user should verify the result. Do not use this if you do not understand the implications. .RE .PP This has the effect of appending lines from all the merging files, which is exactly what we need. So let's give it a try. First, back out the botched rebase: .PP .Vb 1 \& > git rebase \-\-abort .Ve .PP Now add the union merge driver to \fI.gitattributes\fR for \fIsqitch.plan\fR and rebase again: .PP .Vb 8 \& > echo sqitch.plan merge=union > .gitattributes \& > git rebase main \& First, rewinding head to replay your work on top of it... \& Applying: Add hashtags table. \& Using index info to reconstruct a base tree... \& M sqitch.plan \& Falling back to patching base and 3\-way merge... \& Auto\-merging sqitch.plan .Ve .PP Ah, that looks a bit better. Let's have a look at the plan: .PP .Vb 4 \& > cat sqitch.plan \& %syntax\-version=1.0.0 \& %project=flipr \& %uri=https://github.com/sqitchers/sqitch\-sqlite\-intro/ \& \& users 2013\-12\-31T18:06:04Z Marge N. O’Vera # Creates table to track our users. \& flips [users] 2013\-12\-31T19:01:40Z Marge N. O’Vera # Adds table for storing flips. \& userflips [users flips] 2013\-12\-31T19:11:11Z Marge N. O’Vera # Creates the userflips view. \& @v1.0.0\-dev1 2013\-12\-31T19:13:02Z Marge N. O’Vera # Tag v1.0.0\-dev1. \& \& lists [users] 2013\-12\-31T19:28:05Z Marge N. O’Vera # Adds table for storing lists. \& hashtags [flips] 2013\-12\-31T19:30:13Z Marge N. O’Vera # Adds table for storing hashtags. .Ve .PP Note that it has appended the changes from the merged "lists" branch, and then merged the changes from our "hashtags" branch. Test it to make sure it works as expected: .PP .Vb 12 \& > sqitch rebase \-y \& Reverting all changes from flipr_test \& \- hashtags ................ ok \& \- userflips @v1.0.0\-dev1 .. ok \& \- flips ................... ok \& \- users ................... ok \& Deploying changes to flipr_test \& + users ................... ok \& + flips ................... ok \& + userflips @v1.0.0\-dev1 .. ok \& + lists ................... ok \& + hashtags ................ ok .Ve .PP Note the use of \f(CW\*(C`rebase\*(C'\fR, which combines a \&\f(CW\*(C`revert\*(C'\fR and a \f(CW\*(C`deploy\*(C'\fR into a single command. Handy, right? It correctly reverted our changes, and then deployed them all again in the proper order. So let's commit \fI.gitattributes\fR; seems worthwhile to keep that change: .PP .Vb 5 \& > git add . \& > git commit \-m \*(AqAdd \`.gitattributes\` with union merge for \`sqitch.plan\`.\*(Aq \& [hashtags 4f93ac4] Add \`.gitattributes\` with union merge for \`sqitch.plan\`. \& 1 file changed, 1 insertion(+) \& create mode 100644 .gitattributes .Ve .SS "Merges Mastered" .IX Subsection "Merges Mastered" And now, finally, we can merge into \f(CW\*(C`main\*(C'\fR: .PP .Vb 10 \& > git checkout main \& Switched to branch \*(Aqmain\*(Aq \& > git merge \-\-no\-ff hashtags \-m "Merge branch \*(Aqhashtags\*(Aq" \& Merge made by the \*(Aqrecursive\*(Aq strategy. \& .gitattributes | 1 + \& deploy/hashtags.sql | 12 ++++++++++++ \& revert/hashtags.sql | 7 +++++++ \& sqitch.plan | 1 + \& verify/hashtags.sql | 7 +++++++ \& 5 files changed, 28 insertions(+) \& create mode 100644 .gitattributes \& create mode 100644 deploy/hashtags.sql \& create mode 100644 revert/hashtags.sql \& create mode 100644 verify/hashtags.sql .Ve .PP And double-check our work: .PP .Vb 4 \& > cat sqitch.plan \& %syntax\-version=1.0.0 \& %project=flipr \& %uri=https://github.com/sqitchers/sqitch\-sqlite\-intro/ \& \& users 2013\-12\-31T18:06:04Z Marge N. O’Vera # Creates table to track our users. \& flips [users] 2013\-12\-31T19:01:40Z Marge N. O’Vera # Adds table for storing flips. \& userflips [users flips] 2013\-12\-31T19:11:11Z Marge N. O’Vera # Creates the userflips view. \& @v1.0.0\-dev1 2013\-12\-31T19:13:02Z Marge N. O’Vera # Tag v1.0.0\-dev1. \& \& lists [users] 2013\-12\-31T19:28:05Z Marge N. O’Vera # Adds table for storing lists. \& hashtags [flips] 2013\-12\-31T19:30:13Z Marge N. O’Vera # Adds table for storing hashtags. .Ve .PP Much much better, a nice clean main now. And because it is now identical to the "hashtags" branch, we can just carry on. Go ahead and tag it, bundle, and release: .PP .Vb 10 \& > sqitch tag v1.0.0\-dev2 \-n \*(AqTag v1.0.0\-dev2.\*(Aq \& Tagged "hashtags" with @v1.0.0\-dev2 \& > git commit \-am \*(AqTag the database with v1.0.0\-dev2.\*(Aq \& [main 7abfd9b] Tag the database with v1.0.0\-dev2. \& 1 file changed, 1 insertion(+) \& > git tag v1.0.0\-dev2 \-am \*(AqTag v1.0.0\-dev2\*(Aq \& > sqitch bundle \-\-dest\-dir flipr\-1.0.0\-dev2 \& Bundling into flipr\-1.0.0\-dev2 \& Writing config \& Writing plan \& Writing scripts \& + users \& + flips \& + userflips @v1.0.0\-dev1 \& + lists \& + hashtags @v1.0.0\-dev2 .Ve .PP Note the use of the \f(CW\*(C`\-\-dest\-dir\*(C'\fR option to \f(CW\*(C`sqitch bundle\*(C'\fR. Just a nicer way to create the top-level directory name so we don't have to rename it from \&\fIbundle\fR. .SH "In Place Changes" .IX Header "In Place Changes" Well, some folks have been testing the \f(CW\*(C`1.0.0\-dev2\*(C'\fR release and have demanded that Twitter user links be added to Flipr pages. Why anyone would want to include social network links in an anti-social networking app is beyond us programmers, but we're just the plumbers, right? Gotta go with what Product demands. The upshot is that we need to update the \f(CW\*(C`userflips\*(C'\fR view, which is used for the feature in question, to include the Twitter user names. .PP Normally, modifying views in database changes is a PITA . You have to make changes like these: .IP 1. 4 Copy \fIdeploy/userflips.sql\fR to \fIdeploy/userflips_twitter.sql\fR. .IP 2. 4 Edit \fIdeploy/userflips_twitter.sql\fR to drop and re-create the view with the \&\f(CW\*(C`twitter\*(C'\fR column to the view. .IP 3. 4 Copy \fIdeploy/userflips.sql\fR to \fIrevert/userflips_twitter.sql\fR. Yes, copy the original change script to the new revert change. .IP 4. 4 Add a \f(CW\*(C`DROP VIEW\*(C'\fR statement to \fIrevert/userflips_twitter.sql\fR. .IP 5. 4 Copy \fIverify/userflips.sql\fR to \fIverify/userflips_twitter.sql\fR. .IP 6. 4 Modify \fIverify/userflips_twitter.sql\fR to include a check for the \f(CW\*(C`twiter\*(C'\fR column. .IP 7. 4 Test the changes to make sure you can deploy and revert the \&\f(CW\*(C`userflips_twitter\*(C'\fR change. .PP But you can have Sqitch do most of the work for you. The only requirement is that a tag appear between the two instances of a change we want to modify. In general, you're going to make a change like this after a release, which you've tagged anyway, right? Well we have, with \f(CW\*(C`@v1.0.0\-dev2\*(C'\fR added in the previous section. With that, we can let Sqitch do most of the hard work for us, thanks to the \f(CW\*(C`rework\*(C'\fR command, which is similar to \&\f(CW\*(C`add\*(C'\fR: .PP .Vb 6 \& > sqitch rework userflips \-n \*(AqAdds userflips.twitter.\*(Aq \& Added "userflips [userflips@v1.0.0\-dev2]" to sqitch.plan. \& Modify these files as appropriate: \& * deploy/userflips.sql \& * revert/userflips.sql \& * verify/userflips.sql .Ve .PP Oh, so we can edit those files in place. Nice! How does Sqitch do it? Well, in point of fact, it has copied the files to stand in for the previous instance of the \f(CW\*(C`userflips\*(C'\fR change, which we can see via \f(CW\*(C`git status\*(C'\fR: .PP .Vb 10 \& > git status \& # On branch main \& # Your branch is ahead of \*(Aqorigin/main\*(Aq by 4 commits. \& # (use "git push" to publish your local commits) \& # \& # Changes not staged for commit: \& # (use "git add ..." to update what will be committed) \& # (use "git checkout \-\- ..." to discard changes in working directory) \& # \& # modified: revert/userflips.sql \& # modified: sqitch.plan \& # \& # Untracked files: \& # (use "git add ..." to include in what will be committed) \& # \& # deploy/userflips@v1.0.0\-dev2.sql \& # revert/userflips@v1.0.0\-dev2.sql \& # verify/userflips@v1.0.0\-dev2.sql \& no changes added to commit (use "git add" and/or "git commit \-a") .Ve .PP The "untracked files" part of the output is the first thing to notice. They are all named \f(CW\*(C`userflips@v1.0.0\-dev2.sql\*(C'\fR. What that means is: "the \&\f(CW\*(C`userflips\*(C'\fR change as it was implemented as of the \f(CW\*(C`@v1.0.0\-dev2\*(C'\fR tag." These are copies of the original scripts, and thereafter Sqitch will find them when it needs to run scripts for the first instance of the \f(CW\*(C`userflips\*(C'\fR change. As such, it's important not to change them again. But hey, if you're reworking the change, you shouldn't need to. .PP The other thing to notice is that \fIrevert/userflips.sql\fR has changed. Sqitch replaced it with the original deploy script. As of now, \&\fIdeploy/userflips.sql\fR and \fIrevert/userflips.sql\fR are identical. This is on the assumption that the deploy script will be changed (we're reworking it, remember?), and that the revert script should actually change things back to how they were before. Of course, the original deploy script won't be idempotent \-\- that is, able to be applied multiple times without changing the result beyond the initial application. It could be if SQLite supported \f(CW\*(C`CREATE OR REPLACE VIEW\*(C'\fR, but since it doesn't, we will have to edit the script to drop the view before creating it. Or, more simply, it needs to be updated to revert changes back to how they were as-of the deployment of \fIdeploy/userflips@v1.0.0\-dev2.sql\fR. .PP Modify \fIdeploy/userflips.sql\fR to add the \f(CW\*(C`twitter\*(C'\fR column; in fact, let's also add a \f(CW\*(C`DROP VIEW IF EXISTS\*(C'\fR statement, in case we need to rework this change again in the future: .PP .Vb 1 \& @@ \-4,8 +4,9 @@ \& \& BEGIN; \& \& +DROP VIEW IF EXISTS userflips; \& CREATE VIEW userflips AS \& \-SELECT f.id, u.nickname, u.fullname, f.body, f.timestamp \& +SELECT f.id, u.nickname, u.fullname, u.twitter, f.body, f.timestamp \& FROM users u \& JOIN flips f ON u.nickname = f.nickname; .Ve .PP Next, modify \fIverify/userflips.sql\fR to check for the \f(CW\*(C`twitter\*(C'\fR column. Here's the diff: .PP .Vb 1 \& @@ \-2,7 +2,7 @@ \& \& BEGIN; \& \& \-SELECT id, nickname, fullname, body, timestamp \& +SELECT id, nickname, fullname, twitter, body, timestamp \& FROM userflips \& WHERE 0; .Ve .PP And finally, modify \fIrevert/userflips.sql\fR to drop the view before creating it: .PP .Vb 1 \& @@ \-4,6 +4,7 @@ \& \& BEGIN; \& \& +DROP VIEW IF EXISTS userflips; \& CREATE VIEW userflips AS \& SELECT f.id, u.nickname, u.fullname, f.body, f.timestamp \& FROM users u .Ve .PP Note that if we had included that statement when we originally created the \&\f(CW\*(C`userflips\*(C'\fR change, we wouldn't have to change this file at all. .PP Now try a deployment: .PP .Vb 3 \& > sqitch deploy \& Deploying changes to flipr_test \& + userflips .. ok .Ve .PP So, are the changes deployed? .PP .Vb 5 \& > sqlite3 flipr_test.db \*(Aq.schema userflips\*(Aq \& CREATE VIEW userflips AS \& SELECT f.id, u.nickname, u.fullname, u.twitter, f.body, f.timestamp \& FROM users u \& JOIN flips f ON u.nickname = f.nickname; .Ve .PP Awesome, the view now includes the \f(CW\*(C`twitter\*(C'\fR column. But can we revert? .PP .Vb 3 \& > sqitch revert \-\-to @HEAD^ \-y \& Reverting changes to hashtags @v1.0.0\-dev2 from flipr_test \& \- userflips .. ok .Ve .PP Did that work, is the \f(CW\*(C`twitter\*(C'\fR column gone? .PP .Vb 5 \& > sqlite3 flipr_test.db \*(Aq.schema userflips\*(Aq \& CREATE VIEW userflips AS \& SELECT f.id, u.nickname, u.fullname, f.body, f.timestamp \& FROM users u \& JOIN flips f ON u.nickname = f.nickname; .Ve .PP Yes, it works! Sqitch properly finds the original instances of these changes in the new script files that include tags. .PP Excellent. Let's go ahead and commit these changes: .PP .Vb 7 \& > git add . \& > git commit \-m \*(AqAdd the twitter column to the userflips view.\*(Aq \& [main 3eb96d9] Add the twitter column to the userflips view. \& 7 files changed, 40 insertions(+), 4 deletions(\-) \& create mode 100644 deploy/userflips@v1.0.0\-dev2.sql \& create mode 100644 revert/userflips@v1.0.0\-dev2.sql \& create mode 100644 verify/userflips@v1.0.0\-dev2.sql .Ve .SH "More to Come" .IX Header "More to Come" Sqitch is a work in progress. Better integration with version control systems is planned to make managing idempotent reworkings even easier. Stay tuned. .SH Author .IX Header "Author" David E. Wheeler .SH License .IX Header "License" Copyright (c) 2012\-2024 iovation Inc., David E. Wheeler .PP Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: .PP The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. .PP THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.