Created
September 17, 2015 09:13
-
-
Save i-van/67ebb982291f711317ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var co = require('co'); | |
module.exports = { | |
up: co.wrap(function*(migration, DataTypes) { | |
var sequelize = migration.sequelize; | |
yield sequelize.query(` | |
CREATE TABLE public.feeds ( | |
id serial, | |
location geography NOT NULL, | |
type integer NOT NULL DEFAULT 1, | |
title character varying(255) NOT NULL, | |
description text, | |
image_url character varying(255), | |
source character varying(255), | |
created_at timestamp with time zone NOT NULL, | |
updated_at timestamp with time zone NOT NULL, | |
created_by integer, | |
updated_by integer, | |
PRIMARY KEY ("id") | |
) | |
`); | |
}), | |
down: co.wrap(function*(migration, DataTypes) { | |
yield migration.dropTable('feeds'); | |
}) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment