Skip to content

Commit 5a1ac0f

Browse files
committed
fix migration
1 parent be9a3d1 commit 5a1ac0f

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

config.ru

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# config.ru
2+
3+
require './app'
4+
run Sinatra::Application

db/migrate/20180518224016_create_partners.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ def self.up
33
create_table :partners do |t|
44
t.string :name
55
t.string :last_name
6-
t.integer :rut, unique: true
6+
t.integer :rut
77
t.timestamps
88
end
9+
add_index :partners, :rut, unique: true
910
end
1011

1112
def self.down

db/schema.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This file is auto-generated from the current state of the database. Instead
2+
# of editing this file, please use the migrations feature of Active Record to
3+
# incrementally modify your database, and then regenerate this schema definition.
4+
#
5+
# Note that this schema.rb definition is the authoritative source for your
6+
# database schema. If you need to create the application database on another
7+
# system, you should be using db:schema:load, not running all the migrations
8+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
9+
# you'll amass, the slower it'll run and the greater likelihood for issues).
10+
#
11+
# It's strongly recommended that you check this file into your version control system.
12+
13+
ActiveRecord::Schema.define(version: 2018_05_18_224016) do
14+
15+
# These are extensions that must be enabled in order to support this database
16+
enable_extension "plpgsql"
17+
18+
create_table "partners", force: :cascade do |t|
19+
t.string "name"
20+
t.string "last_name"
21+
t.integer "rut"
22+
t.datetime "created_at", null: false
23+
t.datetime "updated_at", null: false
24+
t.index ["rut"], name: "index_partners_on_rut", unique: true
25+
end
26+
27+
end

0 commit comments

Comments
 (0)