created template selecting
This commit is contained in:
10
web/db/migrate/20160220121556_create_configuration_files.rb
Normal file
10
web/db/migrate/20160220121556_create_configuration_files.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateConfigurationFiles < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :configuration_files do |t|
|
||||
t.string :namehash, null: false
|
||||
t.integer :server_id, null: false
|
||||
t.integer :file_type_id, null: false
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
8
web/db/migrate/20160220123353_create_file_types.rb
Normal file
8
web/db/migrate/20160220123353_create_file_types.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class CreateFileTypes < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :file_types do |t|
|
||||
t.string :name, null: false
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
11
web/db/migrate/20160220125727_create_file_versions.rb
Normal file
11
web/db/migrate/20160220125727_create_file_versions.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateFileVersions < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :file_versions do |t|
|
||||
t.integer :number, null: false, default: 1
|
||||
t.boolean :pulled, null: false, default: false
|
||||
t.integer :configuration_file_id, null: false
|
||||
t.binary :content, :limit => 10.megabyte
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
class CreateConfigurationTemplates < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :configuration_templates do |t|
|
||||
t.string :name, null: false
|
||||
t.integer :operating_system_id, null: false
|
||||
t.text :content, null: false
|
||||
t.integer :file_type_id, null: false
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddConfigurationTemplateIdToConfigurationFile < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :configuration_files, :configuration_template_id, :integer
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class AddIconToConfigurationTemplate < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :configuration_templates, :icon, :string
|
||||
add_column :operating_systems, :icon, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddDescriptionToConfigurationTemplate < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :configuration_templates, :description, :text, null: false, default: "Empty description"
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddFilePathToConfigurationTemplate < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :configuration_templates, :file_path, :string, null: false, default: '/tmp/configuration.txt'
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user