mirror of
http://ghproxy.cn/https://github.com/multunus/onemdm-server
synced 2025-12-06 02:04:57 +00:00
Added Models App, Installation Batch Installation
This commit is contained in:
10
db/migrate/20151113123015_create_applications.rb
Normal file
10
db/migrate/20151113123015_create_applications.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateApplications < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :applications do |t|
|
||||
t.string :name
|
||||
t.string :package_name
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
5
db/migrate/20151113124226_rename_application_to_app.rb
Normal file
5
db/migrate/20151113124226_rename_application_to_app.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class RenameApplicationToApp < ActiveRecord::Migration
|
||||
def change
|
||||
rename_table :applications, :apps
|
||||
end
|
||||
end
|
||||
9
db/migrate/20151113131647_create_batch_installations.rb
Normal file
9
db/migrate/20151113131647_create_batch_installations.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class CreateBatchInstallations < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :batch_installations do |t|
|
||||
t.integer :app_id
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20151113132152_create_installations.rb
Normal file
11
db/migrate/20151113132152_create_installations.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateInstallations < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :installations do |t|
|
||||
t.integer :device_id
|
||||
t.integer :batch_installation_id
|
||||
t.integer :status
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class ChangeStatusDataTypeFromStringToIntegerInInstallation < ActiveRecord::Migration
|
||||
def change
|
||||
change_column :installations, :status, :integer
|
||||
end
|
||||
end
|
||||
23
db/schema.rb
23
db/schema.rb
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20151113095735) do
|
||||
ActiveRecord::Schema.define(version: 20151113140645) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -49,6 +49,19 @@ ActiveRecord::Schema.define(version: 20151113095735) do
|
||||
add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true, using: :btree
|
||||
add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true, using: :btree
|
||||
|
||||
create_table "apps", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "package_name"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "batch_installations", force: :cascade do |t|
|
||||
t.integer "app_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "devices", force: :cascade do |t|
|
||||
t.string "model"
|
||||
t.string "unique_id"
|
||||
@@ -69,5 +82,13 @@ ActiveRecord::Schema.define(version: 20151113095735) do
|
||||
|
||||
add_index "heartbeats", ["device_id"], name: "index_heartbeats_on_device_id", using: :btree
|
||||
|
||||
create_table "installations", force: :cascade do |t|
|
||||
t.integer "device_id"
|
||||
t.integer "batch_installation_id"
|
||||
t.integer "status"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
add_foreign_key "heartbeats", "devices"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user