Permalink
Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up| exports.up = function(knex, Promise) { | |
| return knex.schema | |
| .createTable('Users', function(table) { | |
| table.integer('user_id').primary(); | |
| table.string('name').notNull(); | |
| table.string('handle').notNull(); | |
| table.string('location').notNull(); | |
| table.string('description').notNull(); | |
| table.integer('followers_count').notNull(); | |
| table.integer('friends_count').notNull(); | |
| table.integer('favourites_count').notNull(); | |
| table.string('following'); | |
| }) | |
| .then(() => { | |
| return knex.schema.createTable('Tweets', function(table) { | |
| table | |
| .uuid('tweet_id') | |
| .notNullable() | |
| .primary(); | |
| table.string('tweet').notNull(); | |
| table.boolean('retweeted').notNull(); | |
| table.integer('retweet_count').notNull(); | |
| table.boolean('favorited').notNull(); | |
| table.string('created_at').notNull(); | |
| table.integer('user_id').notNull(); | |
| }); | |
| }); | |
| }; | |
| exports.down = function(knex, Promise) { | |
| return Promise.all([ | |
| knex.schema.dropTableIfExists('Users'), | |
| knex.schema.dropTableIfExists('Tweets'), | |
| ]); | |
| }; |