File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change
1
+ # config.ru
2
+
3
+ require './app'
4
+ run Sinatra ::Application
Original file line number Diff line number Diff line change @@ -3,9 +3,10 @@ def self.up
3
3
create_table :partners do |t |
4
4
t . string :name
5
5
t . string :last_name
6
- t . integer :rut , unique : true
6
+ t . integer :rut
7
7
t . timestamps
8
8
end
9
+ add_index :partners , :rut , unique : true
9
10
end
10
11
11
12
def self . down
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments