Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now watch how Hobo can create a single migration for all of these: $ ./script/generate hobo_migration Fire up the app. It's not a polished UI of course, but we do actually have a working application. Make sure you are logged in as an administrator (e.g. the user who signed up first), and spend a few minutes populating the app with projects, stories and tasks. With some more very simple changes, and without even touching the views, we can get surprisingly close to a decent UI.
- Loading branch information
1 parent
399315a
commit b64ada3
Showing
2 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
db/migrate/20091201020837_hobo_migration_initial_models.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
class HoboMigrationInitialModels < ActiveRecord::Migration | ||
def self.up | ||
create_table :task_assignments do |t| | ||
t.datetime :created_at | ||
t.datetime :updated_at | ||
t.integer :user_id | ||
t.integer :task_id | ||
end | ||
add_index :task_assignments, [:user_id] | ||
add_index :task_assignments, [:task_id] | ||
|
||
create_table :projects do |t| | ||
t.string :name | ||
t.datetime :created_at | ||
t.datetime :updated_at | ||
end | ||
|
||
create_table :tasks do |t| | ||
t.string :description | ||
t.datetime :created_at | ||
t.datetime :updated_at | ||
t.integer :story_id | ||
end | ||
add_index :tasks, [:story_id] | ||
|
||
create_table :stories do |t| | ||
t.string :title | ||
t.text :body | ||
t.string :status | ||
t.datetime :created_at | ||
t.datetime :updated_at | ||
t.integer :project_id | ||
end | ||
add_index :stories, [:project_id] | ||
end | ||
|
||
def self.down | ||
drop_table :task_assignments | ||
drop_table :projects | ||
drop_table :tasks | ||
drop_table :stories | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters