[前][次][番号順一覧][スレッド一覧]

rails:1816

From: Kyoko Sato <k.sato@a...>
Date: Thu, 09 Nov 2006 18:43:29 +0900
Subject: [rails:1816] Re: 既存のデータベースとscaffold

佐藤です。[rails:1815] を訂正します。

schema_info をMySQL Query Browserで作成していたので、削除しました。
その後実行したら、以下になりました。

[root@ad-opt-03 System]$ rake db:migrate
(in /export/home/admin/sato/rails/DuraAD)
== CreateAccounts: migrating ==================================================
-- create_table(:accounts)
rake aborted!
undefined method `[]' for :primary_key:Symbol

(See full trace by running task with --trace)


001_create_accounts.rb
create_tableと drop_tableを accounts -> accountとしてrake db:migrate
class CreateAccounts < ActiveRecord::Migration
  def self.up
    create_table :accounts do |t|
      t.column :seq, :integer, :primary_key
      t.column :uid, :integer, :limit => 16
      t.column :uname, :string, :limit => 100
      t.column :pass, :string, :limit => 100
      t.column :categoryID, :boolean
      t.column :categoryName, :string, :limit => 100
      t.column :groupid, :integer, :limit => 8
      t.column :groupName, :string, :limit => 100
      t.column :text3, :text
      t.column :text4, :text
      t.column :text5, :text
      t.column :text6, :text
      t.column :text7, :text
      t.column :text8, :text
      t.column :text9, :text
      t.column :text10, :text
      t.column :userLevel, :integer, :limit => 16
      t.column :siteID, :integer, :limit => 16
      t.column :campRW, :string, :limit => 1
      t.column :reportRW, :string, :limit => 1
      t.column :systemRW, :string, :limit => 1
      t.column :URL, :string, :limit => 200
    end
  end

  def self.down
    drop_table :accounts
  end
end

--
ML: rails@r...
使い方: http://QuickML.com/

[前][次][番号順一覧][スレッド一覧]

      1799 2006-11-06 12:15 [katayama@l...       ] Railsサイトを開設しました               
      1800 2006-11-06 12:58 ┗[tf@s...             ]                                       
      1801 2006-11-06 13:09  ┗[katayama@l...       ]                                     
      1802 2006-11-06 13:27   ┗[tf@s...             ]                                   
      1803 2006-11-06 13:39    ┗[katayama@l...       ]                                 
      1804 2006-11-06 13:54     ┗[tf@s...             ]                               
      1805 2006-11-06 14:08      ┣[tf@s...             ]                             
      1812 2006-11-09 08:38      ┗[katayama@l...       ]                             
      1813 2006-11-09 09:51       ┗[k.sato@a...         ] 既存のデータベースとscaffold
      1814 2006-11-09 09:59        ┣[kazuhiko@f...       ]                         
      1815 2006-11-09 10:34        ┃┗[k.sato@a...         ]                       
->    1816 2006-11-09 10:43        ┃ ┗[k.sato@a...         ]                     
      1817 2006-11-09 10:52        ┃  ┗[sakuro@e...         ]                   
      1818 2006-11-09 11:01        ┃   ┗[k.sato@a...         ]                 
      1819 2006-11-09 11:37        ┃    ┣[sakuro@e...         ]               
      1820 2006-11-09 11:51        ┃    ┃┗[k.sato@a...         ]             
      1821 2006-11-09 12:00        ┃    ┃ ┣[daisaito@l...       ]           
      1822 2006-11-09 12:35        ┃    ┃ ┗[naoji@t...          ]           
      1859 2006-11-30 06:42        ┃    ┗[k.sato@a...         ]               
      1823 2006-11-09 15:18        ┗[issei.m@g...        ]                         
      1835 2006-11-15 09:31         ┣[k.sato@a...         ]                       
      1836 2006-11-15 11:39         ┃┗[k.sato@a...         ]                     
      1837 2006-11-15 12:09         ┃ ┗[issei.m@g...        ]                   
      1838 2006-11-15 13:01         ┃  ┗[andyjpn@g...        ]                 
      1878 2006-12-07 07:19         ┗[k.sato@a...         ] WEBrickが起動してくれません
      1879 2006-12-07 07:35          ┗[sakuro@e...         ]                     
      1880 2006-12-07 09:25           ┗[k.sato@a...         ]