Skip to content

Instantly share code, notes, and snippets.

@thgaskell
Created July 9, 2015 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thgaskell/fe73b2b29d25ddc20e4b to your computer and use it in GitHub Desktop.
Save thgaskell/fe73b2b29d25ddc20e4b to your computer and use it in GitHub Desktop.
Pixel Painter Schemas

Pixel Painter Schema + Migrations

Using your existing Pixel Painter project, we're going to upgrade it to use Express (if it isn't already).

In addition, intialize the project with sequelize, to create the folders: config, migrations, and models.

Now that we know a little bit about creating migrations, let's use Sequelize to create a couple migration files.

  1. Using sequelize model:create to create model and migration files for a Drawing table.
  2. The only requirement for the Drawing table is that it must have a data column, with the data type json.
  3. After creating your migration files, create a seed folder and create a script to add atleast one drawing to your database! (remember to run migrations) before you seed your database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment