diff options
author | gitlabhq <m@gitlabhq.com> | 2011-10-17 01:07:10 +0400 |
---|---|---|
committer | gitlabhq <m@gitlabhq.com> | 2011-10-17 01:07:10 +0400 |
commit | 9265de3d25715aeafd38a4ef41596dca058dc18c (patch) | |
tree | e755a2c4c0c0451c90a8bc0e75ffae1950a2f6fd /db | |
parent | 526ad466c86e69c3447c192d8cae8da653556058 (diff) |
snippets are ready
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20111016183422_create_snippets.rb | 12 | ||||
-rw-r--r-- | db/migrate/20111016193417_add_content_type_to_snippets.rb | 5 | ||||
-rw-r--r-- | db/migrate/20111016195506_add_file_name_to_snippets.rb | 6 | ||||
-rw-r--r-- | db/schema.rb | 12 |
4 files changed, 34 insertions, 1 deletions
diff --git a/db/migrate/20111016183422_create_snippets.rb b/db/migrate/20111016183422_create_snippets.rb new file mode 100644 index 00000000000..9b0bf201cba --- /dev/null +++ b/db/migrate/20111016183422_create_snippets.rb @@ -0,0 +1,12 @@ +class CreateSnippets < ActiveRecord::Migration + def change + create_table :snippets do |t| + t.string :title + t.text :content + t.integer :author_id, :null => false + t.integer :project_id, :null => false + + t.timestamps + end + end +end diff --git a/db/migrate/20111016193417_add_content_type_to_snippets.rb b/db/migrate/20111016193417_add_content_type_to_snippets.rb new file mode 100644 index 00000000000..511a6793f4f --- /dev/null +++ b/db/migrate/20111016193417_add_content_type_to_snippets.rb @@ -0,0 +1,5 @@ +class AddContentTypeToSnippets < ActiveRecord::Migration + def change + add_column :snippets, :content_type, :string, :null => false, :default => "txt" + end +end diff --git a/db/migrate/20111016195506_add_file_name_to_snippets.rb b/db/migrate/20111016195506_add_file_name_to_snippets.rb new file mode 100644 index 00000000000..d378d225ec1 --- /dev/null +++ b/db/migrate/20111016195506_add_file_name_to_snippets.rb @@ -0,0 +1,6 @@ +class AddFileNameToSnippets < ActiveRecord::Migration + def change + add_column :snippets, :file_name, :string + remove_column :snippets, :content_type + end +end diff --git a/db/schema.rb b/db/schema.rb index ed37dbbb923..a819697640a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20111015154310) do +ActiveRecord::Schema.define(:version => 20111016195506) do create_table "issues", :force => true do |t| t.string "title" @@ -56,6 +56,16 @@ ActiveRecord::Schema.define(:version => 20111015154310) do t.integer "owner_id" end + create_table "snippets", :force => true do |t| + t.string "title" + t.text "content" + t.integer "author_id", :null => false + t.integer "project_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.string "file_name" + end + create_table "users", :force => true do |t| t.string "email", :default => "", :null => false t.string "encrypted_password", :limit => 128, :default => "", :null => false |