diff options
| author | hukl <hukl@eight.local> | 2009-02-08 15:15:43 +0100 |
|---|---|---|
| committer | hukl <hukl@eight.local> | 2009-02-08 15:15:43 +0100 |
| commit | a6eea1a843c29112a737e77d6cb813c8980fb836 (patch) | |
| tree | 36433d2027e930404ccb11c61396aba9b3794fb8 /db | |
| parent | bb9d9ccd57ce5673b52a1856dfd32337f4ae4b22 (diff) | |
added basic user model and user_id on page model
to introduce the concept of authors.
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20090208130829_create_users.rb | 16 | ||||
| -rw-r--r-- | db/migrate/20090208130906_add_user_id_to_pages.rb | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/db/migrate/20090208130829_create_users.rb b/db/migrate/20090208130829_create_users.rb new file mode 100644 index 0000000..e91193c --- /dev/null +++ b/db/migrate/20090208130829_create_users.rb | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | class CreateUsers < ActiveRecord::Migration | ||
| 2 | def self.up | ||
| 3 | create_table :users do |t| | ||
| 4 | t.string :login | ||
| 5 | t.string :email | ||
| 6 | t.string :crypted_password | ||
| 7 | t.string :salt | ||
| 8 | |||
| 9 | t.timestamps | ||
| 10 | end | ||
| 11 | end | ||
| 12 | |||
| 13 | def self.down | ||
| 14 | drop_table :users | ||
| 15 | end | ||
| 16 | end | ||
diff --git a/db/migrate/20090208130906_add_user_id_to_pages.rb b/db/migrate/20090208130906_add_user_id_to_pages.rb new file mode 100644 index 0000000..02ebdef --- /dev/null +++ b/db/migrate/20090208130906_add_user_id_to_pages.rb | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | class AddUserIdToPages < ActiveRecord::Migration | ||
| 2 | def self.up | ||
| 3 | add_column :pages, :user_id, :integer | ||
| 4 | end | ||
| 5 | |||
| 6 | def self.down | ||
| 7 | add_column :pages, :user_id | ||
| 8 | end | ||
| 9 | end | ||
