From 4e889f8df469d5e52a48e68b88c4d6e61cf5f440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=B1or=20Rolando?= Date: Sun, 8 Dec 2013 13:15:31 +0100 Subject: [PATCH] Use integer instead of bigint in DB migrations. And hope that this will turn out suitable for post IDs. --- db/migrate/20131208115327_create_reposts.rb | 4 +-- db/schema.rb | 29 +++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 db/schema.rb diff --git a/db/migrate/20131208115327_create_reposts.rb b/db/migrate/20131208115327_create_reposts.rb index 4aad648..26ebb71 100644 --- a/db/migrate/20131208115327_create_reposts.rb +++ b/db/migrate/20131208115327_create_reposts.rb @@ -2,8 +2,8 @@ class CreateReposts < ActiveRecord::Migration def change create_table :reposts do |t| t.string :mentioned - t.bigint :postid - t.bigint :repostid + t.integer :postid + t.integer :repostid t.timestamps end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..eebce9b --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,29 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20131208115327) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "reposts", force: true do |t| + t.string "mentioned" + t.integer "postid" + t.integer "repostid" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "reposts", ["repostid"], name: "index_reposts_on_repostid", using: :btree + +end