Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.

How do I add coordinate Document Tables creation with my migration tool? #635

Closed
vibl opened this issue Sep 27, 2018 · 3 comments
Closed

Comments

@vibl
Copy link

vibl commented Sep 27, 2018

I need to add columns to a Document Table. What is the recommended practice to make sure the table has been created (by db.saveDoc('myTable'...)) before running the migration script that will add the columns to it?

I use https://github.com/golang-migrate/migrate, a simple CLI tool that uses SQL files for migration. It doesn't have the ability to execute arbitrary scripts has part of a migration plan (yet: mattes/migrate#171).

@dmfay
Copy link
Owner

dmfay commented Sep 27, 2018

I usually just copy out the document table DDL into my migration scripts if I need to customize them. You'll need to replace the tokens in that file: schema and table should be pretty obvious, index can be whatever you like, and pkType + pkDefault should be either SERIAL and nothing, or UUID and one of the UUID generation functions.

@dmfay dmfay closed this as completed Sep 27, 2018
@vibl
Copy link
Author

vibl commented Sep 27, 2018

Thanks! I think it would be useful to include it in the doc.

@dmfay
Copy link
Owner

dmfay commented Sep 27, 2018

Migrations are out of scope for Massive, but of course you can publish whatever extensions you like to the registry :) You're right it couldn't hurt to be a little more specific about it in the docs though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants