bosh-director 1.5.0.pre.1113
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +34 -0
- data/bin/bosh-director +36 -0
- data/bin/bosh-director-console +84 -0
- data/bin/bosh-director-drain-workers +42 -0
- data/bin/bosh-director-migrate +58 -0
- data/bin/bosh-director-scheduler +27 -0
- data/bin/bosh-director-worker +76 -0
- data/db/migrations/README +1 -0
- data/db/migrations/director/20110209010747_initial.rb +118 -0
- data/db/migrations/director/20110406055800_add_task_user.rb +9 -0
- data/db/migrations/director/20110518225809_remove_cid_constrain.rb +13 -0
- data/db/migrations/director/20110617211923_add_deployments_release_versions.rb +32 -0
- data/db/migrations/director/20110622212607_add_task_checkpoint_timestamp.rb +9 -0
- data/db/migrations/director/20110628023039_add_state_to_instances.rb +21 -0
- data/db/migrations/director/20110709012332_add_disk_size_to_instances.rb +9 -0
- data/db/migrations/director/20110906183441_add_log_bundles.rb +11 -0
- data/db/migrations/director/20110907194830_add_logs_json_to_templates.rb +9 -0
- data/db/migrations/director/20110915205610_add_persistent_disks.rb +51 -0
- data/db/migrations/director/20111005180929_add_properties.rb +14 -0
- data/db/migrations/director/20111110024617_add_deployment_problems.rb +24 -0
- data/db/migrations/director/20111216214145_recreate_support_for_vms.rb +9 -0
- data/db/migrations/director/20120102084027_add_credentials_to_vms.rb +7 -0
- data/db/migrations/director/20120427235217_allow_multiple_releases_per_deployment.rb +36 -0
- data/db/migrations/director/20120524175805_add_task_type.rb +44 -0
- data/db/migrations/director/20120614001930_delete_redundant_deployment_release_relation.rb +34 -0
- data/db/migrations/director/20120822004528_add_fingerprint_to_templates_and_packages.rb +17 -0
- data/db/migrations/director/20120830191244_add_properties_to_templates.rb +9 -0
- data/db/migrations/director/20121106190739_persist_vm_env.rb +9 -0
- data/db/migrations/director/20130222232131_add_sha1_to_stemcells.rb +9 -0
- data/db/migrations/director/20130312211407_add_commit_hash_to_release_versions.rb +19 -0
- data/db/migrations/director/20130409235338_snapshot.rb +15 -0
- data/db/migrations/director/20130530164918_add_paused_flag_to_instance.rb +14 -0
- data/db/migrations/director/20130531172604_add_director_attributes.rb +13 -0
- data/db/migrations/dns/20120123234908_initial.rb +27 -0
- data/lib/bosh/director.rb +133 -0
- data/lib/bosh/director/agent_client.rb +78 -0
- data/lib/bosh/director/api.rb +29 -0
- data/lib/bosh/director/api/api_helper.rb +81 -0
- data/lib/bosh/director/api/backup_manager.rb +15 -0
- data/lib/bosh/director/api/controller.rb +639 -0
- data/lib/bosh/director/api/controller_helpers.rb +34 -0
- data/lib/bosh/director/api/deployment_lookup.rb +13 -0
- data/lib/bosh/director/api/deployment_manager.rb +60 -0
- data/lib/bosh/director/api/http_constants.rb +16 -0
- data/lib/bosh/director/api/instance_lookup.rb +44 -0
- data/lib/bosh/director/api/instance_manager.rb +63 -0
- data/lib/bosh/director/api/problem_manager.rb +40 -0
- data/lib/bosh/director/api/property_manager.rb +69 -0
- data/lib/bosh/director/api/release_manager.rb +59 -0
- data/lib/bosh/director/api/resource_manager.rb +69 -0
- data/lib/bosh/director/api/resurrector_manager.rb +15 -0
- data/lib/bosh/director/api/snapshot_manager.rb +94 -0
- data/lib/bosh/director/api/stemcell_manager.rb +50 -0
- data/lib/bosh/director/api/task_helper.rb +46 -0
- data/lib/bosh/director/api/task_manager.rb +64 -0
- data/lib/bosh/director/api/user_manager.rb +72 -0
- data/lib/bosh/director/api/vm_state_manager.rb +11 -0
- data/lib/bosh/director/app.rb +35 -0
- data/lib/bosh/director/blob_util.rb +87 -0
- data/lib/bosh/director/blobstores.rb +29 -0
- data/lib/bosh/director/client.rb +156 -0
- data/lib/bosh/director/cloudcheck_helper.rb +204 -0
- data/lib/bosh/director/compile_task.rb +157 -0
- data/lib/bosh/director/config.rb +370 -0
- data/lib/bosh/director/configuration_hasher.rb +114 -0
- data/lib/bosh/director/cycle_helper.rb +36 -0
- data/lib/bosh/director/db_backup.rb +22 -0
- data/lib/bosh/director/db_backup/adapter.rb +3 -0
- data/lib/bosh/director/db_backup/adapter/mysql2.rb +27 -0
- data/lib/bosh/director/db_backup/adapter/postgres.rb +36 -0
- data/lib/bosh/director/db_backup/adapter/sqlite.rb +17 -0
- data/lib/bosh/director/db_backup/error.rb +10 -0
- data/lib/bosh/director/deployment_plan.rb +26 -0
- data/lib/bosh/director/deployment_plan/assembler.rb +430 -0
- data/lib/bosh/director/deployment_plan/compilation_config.rb +54 -0
- data/lib/bosh/director/deployment_plan/compiled_package.rb +35 -0
- data/lib/bosh/director/deployment_plan/dynamic_network.rb +91 -0
- data/lib/bosh/director/deployment_plan/idle_vm.rb +109 -0
- data/lib/bosh/director/deployment_plan/instance.rb +413 -0
- data/lib/bosh/director/deployment_plan/job.rb +470 -0
- data/lib/bosh/director/deployment_plan/manual_network.rb +137 -0
- data/lib/bosh/director/deployment_plan/network.rb +74 -0
- data/lib/bosh/director/deployment_plan/network_subnet.rb +167 -0
- data/lib/bosh/director/deployment_plan/planner.rb +288 -0
- data/lib/bosh/director/deployment_plan/preparer.rb +52 -0
- data/lib/bosh/director/deployment_plan/release.rb +126 -0
- data/lib/bosh/director/deployment_plan/resource_pool.rb +143 -0
- data/lib/bosh/director/deployment_plan/resource_pools.rb +68 -0
- data/lib/bosh/director/deployment_plan/stemcell.rb +56 -0
- data/lib/bosh/director/deployment_plan/template.rb +94 -0
- data/lib/bosh/director/deployment_plan/update_config.rb +80 -0
- data/lib/bosh/director/deployment_plan/updater.rb +55 -0
- data/lib/bosh/director/deployment_plan/vip_network.rb +79 -0
- data/lib/bosh/director/dns_helper.rb +204 -0
- data/lib/bosh/director/download_helper.rb +44 -0
- data/lib/bosh/director/duration.rb +36 -0
- data/lib/bosh/director/encryption_helper.rb +10 -0
- data/lib/bosh/director/errors.rb +198 -0
- data/lib/bosh/director/event_log.rb +136 -0
- data/lib/bosh/director/ext.rb +64 -0
- data/lib/bosh/director/hash_string_vals.rb +13 -0
- data/lib/bosh/director/instance_deleter.rb +109 -0
- data/lib/bosh/director/instance_updater.rb +506 -0
- data/lib/bosh/director/ip_util.rb +67 -0
- data/lib/bosh/director/job_queue.rb +16 -0
- data/lib/bosh/director/job_runner.rb +162 -0
- data/lib/bosh/director/job_updater.rb +121 -0
- data/lib/bosh/director/jobs/backup.rb +86 -0
- data/lib/bosh/director/jobs/base_job.rb +66 -0
- data/lib/bosh/director/jobs/cloud_check/apply_resolutions.rb +46 -0
- data/lib/bosh/director/jobs/cloud_check/scan.rb +38 -0
- data/lib/bosh/director/jobs/cloud_check/scan_and_fix.rb +73 -0
- data/lib/bosh/director/jobs/create_snapshot.rb +23 -0
- data/lib/bosh/director/jobs/delete_deployment.rb +183 -0
- data/lib/bosh/director/jobs/delete_deployment_snapshots.rb +34 -0
- data/lib/bosh/director/jobs/delete_release.rb +219 -0
- data/lib/bosh/director/jobs/delete_snapshots.rb +23 -0
- data/lib/bosh/director/jobs/delete_stemcell.rb +102 -0
- data/lib/bosh/director/jobs/fetch_logs.rb +99 -0
- data/lib/bosh/director/jobs/scheduled_backup.rb +38 -0
- data/lib/bosh/director/jobs/snapshot_deployment.rb +61 -0
- data/lib/bosh/director/jobs/snapshot_deployments.rb +23 -0
- data/lib/bosh/director/jobs/snapshot_self.rb +43 -0
- data/lib/bosh/director/jobs/ssh.rb +59 -0
- data/lib/bosh/director/jobs/update_deployment.rb +110 -0
- data/lib/bosh/director/jobs/update_release.rb +672 -0
- data/lib/bosh/director/jobs/update_stemcell.rb +109 -0
- data/lib/bosh/director/jobs/vm_state.rb +89 -0
- data/lib/bosh/director/lock.rb +133 -0
- data/lib/bosh/director/lock_helper.rb +92 -0
- data/lib/bosh/director/models.rb +29 -0
- data/lib/bosh/director/models/compiled_package.rb +33 -0
- data/lib/bosh/director/models/deployment.rb +22 -0
- data/lib/bosh/director/models/deployment_problem.rb +49 -0
- data/lib/bosh/director/models/deployment_property.rb +21 -0
- data/lib/bosh/director/models/director_attribute.rb +9 -0
- data/lib/bosh/director/models/dns.rb +9 -0
- data/lib/bosh/director/models/dns/domain.rb +9 -0
- data/lib/bosh/director/models/dns/record.rb +7 -0
- data/lib/bosh/director/models/helpers/model_helper.rb +7 -0
- data/lib/bosh/director/models/instance.rb +28 -0
- data/lib/bosh/director/models/log_bundle.rb +10 -0
- data/lib/bosh/director/models/package.rb +30 -0
- data/lib/bosh/director/models/persistent_disk.rb +13 -0
- data/lib/bosh/director/models/release.rb +17 -0
- data/lib/bosh/director/models/release_version.rb +16 -0
- data/lib/bosh/director/models/snapshot.rb +13 -0
- data/lib/bosh/director/models/stemcell.rb +18 -0
- data/lib/bosh/director/models/task.rb +10 -0
- data/lib/bosh/director/models/template.rb +44 -0
- data/lib/bosh/director/models/user.rb +11 -0
- data/lib/bosh/director/models/vm.rb +42 -0
- data/lib/bosh/director/nats_rpc.rb +54 -0
- data/lib/bosh/director/network_reservation.rb +121 -0
- data/lib/bosh/director/next_rebase_version.rb +20 -0
- data/lib/bosh/director/package_compiler.rb +423 -0
- data/lib/bosh/director/problem_handlers/base.rb +153 -0
- data/lib/bosh/director/problem_handlers/inactive_disk.rb +112 -0
- data/lib/bosh/director/problem_handlers/invalid_problem.rb +28 -0
- data/lib/bosh/director/problem_handlers/missing_vm.rb +34 -0
- data/lib/bosh/director/problem_handlers/mount_info_mismatch.rb +62 -0
- data/lib/bosh/director/problem_handlers/out_of_sync_vm.rb +64 -0
- data/lib/bosh/director/problem_handlers/unbound_instance_vm.rb +85 -0
- data/lib/bosh/director/problem_handlers/unresponsive_agent.rb +78 -0
- data/lib/bosh/director/problem_resolver.rb +103 -0
- data/lib/bosh/director/problem_scanner.rb +268 -0
- data/lib/bosh/director/resource_pool_updater.rb +216 -0
- data/lib/bosh/director/scheduler.rb +57 -0
- data/lib/bosh/director/sequel.rb +13 -0
- data/lib/bosh/director/tar_gzipper.rb +47 -0
- data/lib/bosh/director/task_result_file.rb +19 -0
- data/lib/bosh/director/thread_pool.rb +8 -0
- data/lib/bosh/director/validation_helper.rb +55 -0
- data/lib/bosh/director/version.rb +7 -0
- data/lib/bosh/director/vm_creator.rb +80 -0
- data/lib/bosh/director/vm_data.rb +63 -0
- data/lib/bosh/director/vm_metadata_updater.rb +29 -0
- data/lib/bosh/director/vm_reuser.rb +63 -0
- data/lib/cloud/dummy.rb +149 -0
- metadata +664 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
# Copyright (c) 2009-2012 VMware, Inc.
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
alter_table(:vms) do
|
6
|
+
set_column_allow_null :cid, true
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
down do
|
11
|
+
raise Sequel::Error, "Irreversible migration, vms:cid might contain nulls so we cannot enforce 'not null' constraint"
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Copyright (c) 2009-2012 VMware, Inc.
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
create_table(:deployments_release_versions) do
|
6
|
+
primary_key :id
|
7
|
+
foreign_key :release_version_id, :release_versions, :null => false
|
8
|
+
foreign_key :deployment_id, :deployments, :null => false
|
9
|
+
unique [:release_version_id, :deployment_id]
|
10
|
+
end
|
11
|
+
|
12
|
+
self[:deployments].each do |deployment|
|
13
|
+
manifest = Psych.load(deployment[:manifest])
|
14
|
+
|
15
|
+
unless manifest.is_a?(Hash) && manifest["release"] && manifest["release"]["version"]
|
16
|
+
raise "Invalid manifest for `#{deployment[:name]}', no version data"
|
17
|
+
end
|
18
|
+
|
19
|
+
release_version = self[:release_versions].filter(:release_id => deployment[:release_id], :version => manifest["release"]["version"].to_s).first
|
20
|
+
|
21
|
+
if release_version.nil?
|
22
|
+
raise "Release version #{manifest["release"]["version"]} referenced by `#{deployment[:name]}' manifest not found"
|
23
|
+
end
|
24
|
+
|
25
|
+
self[:deployments_release_versions].insert(:release_version_id => release_version[:id], :deployment_id => deployment[:id])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
down do
|
30
|
+
drop_table(:deployments_release_versions)
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Copyright (c) 2009-2012 VMware, Inc.
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
alter_table(:instances) do
|
6
|
+
add_column(:state, String)
|
7
|
+
end
|
8
|
+
|
9
|
+
self[:instances].update(:state => "started")
|
10
|
+
|
11
|
+
alter_table(:instances) do
|
12
|
+
set_column_allow_null :state, false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
down do
|
17
|
+
alter_table(:instances) do
|
18
|
+
drop_column(:state)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Copyright (c) 2009-2012 VMware, Inc.
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
create_table(:persistent_disks) do
|
6
|
+
primary_key :id
|
7
|
+
foreign_key :instance_id, :instances, :null => false
|
8
|
+
String :disk_cid, :unique => true, :null => false
|
9
|
+
Integer :size
|
10
|
+
Boolean :active, :default => false
|
11
|
+
end
|
12
|
+
|
13
|
+
self[:instances].each do |instance|
|
14
|
+
next unless instance[:disk_cid]
|
15
|
+
|
16
|
+
new_disk_attrs = {
|
17
|
+
:disk_cid => instance[:disk_cid],
|
18
|
+
:size => instance[:disk_size],
|
19
|
+
:instance_id => instance[:id],
|
20
|
+
:active => true
|
21
|
+
}
|
22
|
+
|
23
|
+
self[:persistent_disks].insert(new_disk_attrs)
|
24
|
+
end
|
25
|
+
|
26
|
+
alter_table(:instances) do
|
27
|
+
drop_column :disk_cid
|
28
|
+
drop_column :disk_size
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
down do
|
33
|
+
alter_table(:instances) do
|
34
|
+
add_column(:disk_size, Integer, :default => 0)
|
35
|
+
add_column(:disk_cid, String)
|
36
|
+
end
|
37
|
+
|
38
|
+
self[:persistent_disks].each do |disk|
|
39
|
+
next unless disk[:active]
|
40
|
+
|
41
|
+
instance_attrs = {
|
42
|
+
:disk_cid => disk[:disk_cid],
|
43
|
+
:disk_size => disk[:size]
|
44
|
+
}
|
45
|
+
|
46
|
+
self[:instances].filter(:id => disk[:instance_id]).update(instance_attrs)
|
47
|
+
end
|
48
|
+
|
49
|
+
drop_table(:persistent_disks)
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Copyright (c) 2009-2012 VMware, Inc.
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
change do
|
5
|
+
create_table :deployment_properties do
|
6
|
+
primary_key :id
|
7
|
+
foreign_key :deployment_id, :deployments, :null => false
|
8
|
+
String :name, :null => false
|
9
|
+
String :value, :null => false
|
10
|
+
|
11
|
+
unique [ :deployment_id, :name ]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Copyright (c) 2009-2012 VMware, Inc.
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
change do
|
5
|
+
create_table :deployment_problems do
|
6
|
+
primary_key :id
|
7
|
+
foreign_key :deployment_id, :deployments, :null => false
|
8
|
+
|
9
|
+
String :state, :null => false
|
10
|
+
|
11
|
+
Integer :resource_id, :null => false
|
12
|
+
String :type, :null => false
|
13
|
+
String :data_json, :text => true, :null => false
|
14
|
+
|
15
|
+
Time :created_at, :null => false
|
16
|
+
Time :last_seen_at, :null => false
|
17
|
+
|
18
|
+
Integer :counter, :null => false, :default => 0
|
19
|
+
|
20
|
+
index [:deployment_id, :type, :state]
|
21
|
+
index [:deployment_id, :state, :created_at]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Copyright (c) 2009-2012 VMware, Inc.
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
create_table :deployments_releases do
|
6
|
+
primary_key :id
|
7
|
+
foreign_key :deployment_id, :deployments, :null => false
|
8
|
+
foreign_key :release_id, :releases, :null => false
|
9
|
+
unique [:deployment_id, :release_id]
|
10
|
+
end
|
11
|
+
|
12
|
+
self[:deployments].each do |deployment|
|
13
|
+
attrs = {
|
14
|
+
:release_id => deployment[:release_id],
|
15
|
+
:deployment_id => deployment[:id]
|
16
|
+
}
|
17
|
+
|
18
|
+
self[:deployments_releases].insert(attrs)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Needed for mysql in order to drop column (doesn't work with other adapters)
|
22
|
+
# newer versions of sequel support drop_foreign_key but the version breaks tests
|
23
|
+
if [:mysql2, :mysql].include?(adapter_scheme)
|
24
|
+
run("alter table deployments drop FOREIGN KEY deployments_ibfk_1")
|
25
|
+
end
|
26
|
+
|
27
|
+
alter_table :deployments do
|
28
|
+
drop_column :release_id
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
down do
|
33
|
+
raise Sequel::Error, "Irreversible migration, cannot easily go from " +
|
34
|
+
"many-to-many to one-to-many"
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Copyright (c) 2009-2012 VMware, Inc.
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
alter_table :tasks do
|
6
|
+
add_column :type, String
|
7
|
+
add_index :description
|
8
|
+
end
|
9
|
+
|
10
|
+
self[:tasks].filter(:description => "create deployment").
|
11
|
+
update(:type => "update_deployment")
|
12
|
+
self[:tasks].filter(:description.like("delete deployment:%")).
|
13
|
+
update(:type => "delete_deployment")
|
14
|
+
self[:tasks].filter(:description => "fetch logs").
|
15
|
+
update(:type => "fetch_logs")
|
16
|
+
self[:tasks].filter(:description.like("ssh:%")).
|
17
|
+
update(:type => "ssh")
|
18
|
+
self[:tasks].filter(:description => "scan cloud").
|
19
|
+
update(:type => "cck_scan")
|
20
|
+
self[:tasks].filter(:description => "apply resolutions").
|
21
|
+
update(:type => "cck_apply")
|
22
|
+
self[:tasks].filter(:description => "retrieve vm-stats").
|
23
|
+
update(:type => "vms")
|
24
|
+
self[:tasks].filter(:description => "create release").
|
25
|
+
update(:type => "update_release")
|
26
|
+
self[:tasks].filter(:description.like("delete release:%")).
|
27
|
+
update(:type => "delete_release")
|
28
|
+
self[:tasks].filter(:description => "create stemcell").
|
29
|
+
update(:type => "update_stemcell")
|
30
|
+
self[:tasks].filter(:description.like("delete stemcell:%")).
|
31
|
+
update(:type => "delete_stemcell")
|
32
|
+
|
33
|
+
alter_table :tasks do
|
34
|
+
set_column_allow_null :type, false
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
down do
|
39
|
+
alter_table :tasks do
|
40
|
+
remove_column :type
|
41
|
+
drop_index :description
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Copyright (c) 2009-2012 VMware, Inc.
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
drop_table :deployments_releases
|
6
|
+
end
|
7
|
+
|
8
|
+
down do
|
9
|
+
create_table :deployments_releases do
|
10
|
+
primary_key :id
|
11
|
+
foreign_key :deployment_id, :deployments, :null => false
|
12
|
+
foreign_key :release_id, :releases, :null => false
|
13
|
+
unique [:deployment_id, :release_id]
|
14
|
+
end
|
15
|
+
|
16
|
+
# Keeping manual track of (release_id, deployment_id) tuples
|
17
|
+
# to avoid having to handle violated uniqueness constraint
|
18
|
+
seen_ids = Set.new
|
19
|
+
|
20
|
+
self[:deployments_release_versions].each do |drv|
|
21
|
+
rv = self[:release_versions].first(:id => drv[:release_version_id])
|
22
|
+
|
23
|
+
unless seen_ids.include?([drv[:deployment_id], rv[:release_id]])
|
24
|
+
attrs = {
|
25
|
+
:release_id => rv[:release_id],
|
26
|
+
:deployment_id => drv[:deployment_id]
|
27
|
+
}
|
28
|
+
|
29
|
+
self[:deployments_releases].insert(attrs)
|
30
|
+
seen_ids << [drv[:deployment_id], rv[:release_id]]
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Copyright (c) 2009-2012 VMware, Inc.
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
change do
|
5
|
+
alter_table(:packages) do
|
6
|
+
add_column :fingerprint, String
|
7
|
+
add_index :fingerprint
|
8
|
+
add_index :sha1
|
9
|
+
end
|
10
|
+
|
11
|
+
alter_table(:templates) do
|
12
|
+
add_column :fingerprint, String
|
13
|
+
add_index :fingerprint
|
14
|
+
add_index :sha1
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Sequel.migration do
|
2
|
+
up do
|
3
|
+
alter_table :release_versions do
|
4
|
+
add_column :commit_hash, String
|
5
|
+
set_column_default :commit_hash, 'unknown'
|
6
|
+
|
7
|
+
add_column :uncommitted_changes, TrueClass
|
8
|
+
set_column_default :uncommitted_changes, false
|
9
|
+
end
|
10
|
+
self[:release_versions].update(commit_hash: 'unknown', uncommitted_changes: false)
|
11
|
+
end
|
12
|
+
|
13
|
+
down do
|
14
|
+
alter_table :release_versions do
|
15
|
+
drop_column :commit_hash
|
16
|
+
drop_column :uncommitted_changes
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Sequel.migration do
|
2
|
+
up do
|
3
|
+
create_table :snapshots do
|
4
|
+
primary_key :id
|
5
|
+
foreign_key :persistent_disk_id, :persistent_disks, :null => false
|
6
|
+
Boolean :clean, :default => false
|
7
|
+
Time :created_at, :null => false
|
8
|
+
String :snapshot_cid, :unique => true, :null => false
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
down do
|
13
|
+
drop_table :snapshots
|
14
|
+
end
|
15
|
+
end
|