Skip to content

Commit

Permalink
arreglo de migracion con error en el nombre
Browse files Browse the repository at this point in the history
  • Loading branch information
exes committed Feb 7, 2019
1 parent 7e94a5e commit 75f0431
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 6 deletions.
4 changes: 0 additions & 4 deletions app/models/rol_permission.rb

This file was deleted.

4 changes: 4 additions & 0 deletions app/models/role_permission.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class RolePermission < ApplicationRecord
belongs_to :role
belongs_to :permission
end
4 changes: 2 additions & 2 deletions db/migrate/20190129134635_create_rol_permissions.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateRolPermissions < ActiveRecord::Migration[5.2]
def change
create_table :rol_permissions do |t|
t.references :rol, foreign_key: true
create_table :role_permissions do |t|
t.references :role, foreign_key: true
t.references :permission, foreign_key: true

t.timestamps
Expand Down
145 changes: 145 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# 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: 2019_01_29_172009) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "devices", force: :cascade do |t|
t.inet "ip_address"
t.string "mac_address"
t.string "user"
t.string "password"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "status"
end

create_table "devise_positions", force: :cascade do |t|
t.bigint "device_id"
t.bigint "location_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "status"
t.index ["device_id"], name: "index_devise_positions_on_device_id"
t.index ["location_id"], name: "index_devise_positions_on_location_id"
end

create_table "locations", force: :cascade do |t|
t.float "lat"
t.float "lon"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "mobile_ips", force: :cascade do |t|
t.bigint "mobile_id"
t.inet "ip_address"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["mobile_id"], name: "index_mobile_ips_on_mobile_id"
end

create_table "mobile_locations", force: :cascade do |t|
t.bigint "mobile_id"
t.bigint "location_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["location_id"], name: "index_mobile_locations_on_location_id"
t.index ["mobile_id"], name: "index_mobile_locations_on_mobile_id"
end

create_table "mobiles", force: :cascade do |t|
t.bigint "user_id"
t.string "model"
t.string "brand"
t.string "mac_address"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "status"
t.index ["user_id"], name: "index_mobiles_on_user_id"
end

create_table "permissions", force: :cascade do |t|
t.string "object"
t.string "method"
t.string "name"
t.string "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "role_permissions", force: :cascade do |t|
t.bigint "role_id"
t.bigint "permission_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["permission_id"], name: "index_role_permissions_on_permission_id"
t.index ["role_id"], name: "index_role_permissions_on_role_id"
end

create_table "roles", force: :cascade do |t|
t.string "name"
t.string "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "users", force: :cascade do |t|
t.bigint "role_id"
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.inet "current_sign_in_ip"
t.inet "last_sign_in_ip"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "status"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
t.index ["role_id"], name: "index_users_on_role_id"
end

create_table "zone_limits", force: :cascade do |t|
t.bigint "zone_id"
t.bigint "location_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["location_id"], name: "index_zone_limits_on_location_id"
t.index ["zone_id"], name: "index_zone_limits_on_zone_id"
end

create_table "zones", force: :cascade do |t|
t.string "name"
t.string "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "status"
end

add_foreign_key "devise_positions", "devices"
add_foreign_key "devise_positions", "locations"
add_foreign_key "mobile_ips", "mobiles"
add_foreign_key "mobile_locations", "locations"
add_foreign_key "mobile_locations", "mobiles"
add_foreign_key "mobiles", "users"
add_foreign_key "role_permissions", "permissions"
add_foreign_key "role_permissions", "roles"
add_foreign_key "zone_limits", "locations"
add_foreign_key "zone_limits", "zones"
end

0 comments on commit 75f0431

Please sign in to comment.