Skip to content

Instantly share code, notes, and snippets.

@i-van
Created September 17, 2015 09:13
Show Gist options
  • Save i-van/67ebb982291f711317ed to your computer and use it in GitHub Desktop.
Save i-van/67ebb982291f711317ed to your computer and use it in GitHub Desktop.
'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