summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/034_create_changesets.rb16
-rw-r--r--db/migrate/035_create_changes.rb16
2 files changed, 32 insertions, 0 deletions
diff --git a/db/migrate/034_create_changesets.rb b/db/migrate/034_create_changesets.rb
new file mode 100644
index 000000000..a78c8e36f
--- /dev/null
+++ b/db/migrate/034_create_changesets.rb
@@ -0,0 +1,16 @@
+class CreateChangesets < ActiveRecord::Migration
+ def self.up
+ create_table :changesets do |t|
+ t.column :repository_id, :integer, :null => false
+ t.column :revision, :integer, :null => false
+ t.column :committer, :string, :limit => 30
+ t.column :committed_on, :datetime, :null => false
+ t.column :comment, :text
+ end
+ add_index :changesets, [:repository_id, :revision], :unique => true, :name => :changesets_repos_rev
+ end
+
+ def self.down
+ drop_table :changesets
+ end
+end
diff --git a/db/migrate/035_create_changes.rb b/db/migrate/035_create_changes.rb
new file mode 100644
index 000000000..fa0cfac3f
--- /dev/null
+++ b/db/migrate/035_create_changes.rb
@@ -0,0 +1,16 @@
+class CreateChanges < ActiveRecord::Migration
+ def self.up
+ create_table :changes do |t|
+ t.column :changeset_id, :integer, :null => false
+ t.column :action, :string, :limit => 1, :default => "", :null => false
+ t.column :path, :string, :default => "", :null => false
+ t.column :from_path, :string
+ t.column :from_revision, :integer
+ end
+ add_index :changes, [:changeset_id], :name => :changesets_changeset_id
+ end
+
+ def self.down
+ drop_table :changes
+ end
+end