# Try creating a table for your model (Legacy)

**URL:** <https://www.ruby-forum.com/t/try-creating-a-table-for-your-model-legacy/107733>\
**Category:** Rails\
**Created:** [June 25, 2007, 8:18pm UTC](https://www.ruby-forum.com/t/try-creating-a-table-for-your-model-legacy/107733 "2007-06-25T20:18:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [June 25, 2007, 8:18pm UTC](https://www.ruby-forum.com/t/try-creating-a-table-for-your-model-legacy/107733/1 "2007-06-25T20:18:20Z")

</div>

what’s meant by the error message “error Before updating scaffolding  
from new DB schema, try creating a table for your model (Legacy)”? Is  
this why I can’t get a list view of the table?

From googling on this code, pardon, it’s not clear to me what the issue  
is. Isn’t the table name correct?

here’s my bash script, which does all the ruby on rails, and it’s  
results:

[thufir@localhost ~]$ mysql -u feeds -p  
Enter password:  
Welcome to the MySQL monitor. Commands end with ; or \g.  
Your MySQL connection id is 21 to server version: 5.0.27

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql\> use legacy;  
Reading table information for completion of table and column names  
You can turn off this feature to get a quicker startup with -A

Database changed  
mysql\> show tables;  
±-----------------+  
| Tables\_in\_legacy |  
±-----------------+  
| legacies |  
±-----------------+  
1 row in set (0.00 sec)

mysql\> describe legacies;  
±------------±-------------±-----±----±--------±---------------+  
| Field | Type | Null | Key | Default | Extra |  
±------------±-------------±-----±----±--------±---------------+  
| id | int(11) | NO | PRI | NULL | auto\_increment |  
| url | varchar(250) | NO | | | |  
| title | varchar(250) | NO | | | |  
| link | varchar(250) | YES | | NULL | |  
| description | varchar(250) | YES | | NULL | |  
±------------±-------------±-----±----±--------±---------------+  
5 rows in set (0.00 sec)

mysql\> quit  
Bye  
[thufir@localhost ~]$  
[thufir@localhost ~]$ ./ruby.legacy.txt

Mon Jun 18 04:05:40 BST 2007  
/home/thufir  
thufir  
Fedora Core release 6 (Zod)  
X=0  
while [$X -le 20]  
do  
echo “”  
X=$((X+1))  
done

date  
pwd  
whoami  
cat /etc/fedora-release  
cat /home/thufir/ruby.legacy.txt

X=0  
while [$X -le 5]  
do  
echo “”  
X=$((X+1))  
done

echo “the database configuration file”  
cat /home/thufir/legacy/config/database.yml

X=0  
while [$X -le 5]  
do  
echo “”  
X=$((X+1))  
done

#echo “rails lecacy…”  
#this command only needs to be executed for the initial setup  
rails legacy

X=0  
while [$X -le 5]  
do  
echo “”  
X=$((X+1))  
done

#echo “ruby /home/thufir/legacy/script/generate controller hello…”  
ruby /home/thufir/legacy/script/generate controller hello

X=0  
while [$X -le 5]  
do  
echo “”  
X=$((X+1))  
done

echo “hello world” \> /home/thufir/legacy/app/views/hello/index.rhtml

X=0  
while [$X -le 5]  
do  
echo “”  
X=$((X+1))  
done

#echo “ruby /home/thufir/legacy/script/generate scaffold legacy…”  
ruby /home/thufir/legacy/script/generate scaffold legacy

X=0  
while [$X -le 5]  
do  
echo “”  
X=$((X+1))  
done

#echo “ruby script/server…”

echo “[http://localhost:3000/legacies/list](http://localhost:3000/legacies/list)”  
echo “[http://localhost:3000/legacy/list](http://localhost:3000/legacy/list)”

X=0  
while [$X -le 5]  
do  
echo “”  
X=$((X+1))  
done

X=0  
while [$X -le 5]  
do  
echo “”  
X=$((X+1))  
done

ruby /home/thufir/legacy/script/server

the database configuration file

# MySQL (default setup). Versions 4.1 and 5.0 are recommended.

# 

# Install the MySQL driver:

# gem install mysql

# On MacOS X:

# gem install mysql – --include=/usr/local/lib

# On Windows:

# gem install mysql

# Choose the win32 build.

# Install MySQL and put its /bin directory on your path.

# 

# And be sure to use new-style password hashing:

# [http://dev.mysql.com/doc/refman/5.0/en/old-client.html](http://dev.mysql.com/doc/refman/5.0/en/old-client.html)

development:  
adapter: mysql  
database: dummy  
username: feeds  
password: password  
socket: /var/lib/mysql/mysql.sock

# Warning: The database defined as ‘test’ will be erased and

# re-generated from your development database when you run ‘rake’.

# Do not set this db to the same as development or production.

test:  
adapter: mysql  
database: dummy  
username: feeds  
password: password  
socket: /var/lib/mysql/mysql.sock

production:  
adapter: mysql  
database: dummy  
username: feeds  
password: password  
socket: /var/lib/mysql/mysql.sock

```
  exists
  exists app/controllers
  exists app/helpers
  exists app/models
  exists app/views/layouts
  exists config/environments
  exists components
  exists db
  exists doc
  exists lib
  exists lib/tasks
  exists log
  exists public/images
  exists public/javascripts
  exists public/stylesheets
  exists script/performance
  exists script/process
  exists test/fixtures
  exists test/functional
  exists test/integration
  exists test/mocks/development
  exists test/mocks/test
  exists test/unit
  exists vendor
  exists vendor/plugins
  exists tmp/sessions
  exists tmp/sockets
  exists tmp/cache
  exists tmp/pids

```

identical Rakefile  
identical README  
identical app/controllers/application.rb  
identical app/helpers/application\_helper.rb  
identical test/test\_helper.rb  
overwrite config/database.yml? [Ynaqd] n  
skip config/database.yml  
identical config/routes.rb  
identical public/.htaccess  
identical config/boot.rb  
identical config/environment.rb  
identical config/environments/production.rb  
identical config/environments/development.rb  
identical config/environments/test.rb  
identical script/about  
identical script/breakpointer  
identical script/console  
identical script/destroy  
identical script/generate  
identical script/performance/benchmarker  
identical script/performance/profiler  
identical script/process/reaper  
identical script/process/spawner  
identical script/process/inspector  
identical script/runner  
identical script/server  
identical script/plugin  
overwrite public/dispatch.rb? [Ynaqd] a  
forcing app  
force public/dispatch.rb  
force public/dispatch.cgi  
force public/dispatch.fcgi  
identical public/404.html  
identical public/500.html  
identical public/index.html  
identical public/favicon.ico  
identical public/robots.txt  
identical public/images/rails.png  
identical public/javascripts/prototype.js  
identical public/javascripts/effects.js  
identical public/javascripts/dragdrop.js  
identical public/javascripts/controls.js  
identical public/javascripts/application.js  
identical doc/README\_FOR\_APP  
identical log/server.log  
identical log/production.log  
force log/development.log  
identical log/test.log

```
  exists app/controllers/
  exists app/helpers/
  exists app/views/hello
  exists test/functional/

```

identical app/controllers/hello\_controller.rb  
identical test/functional/hello\_controller\_test.rb  
identical app/helpers/hello\_helper.rb

```
  exists app/controllers/
  exists app/helpers/
  exists app/views/legacies
  exists app/views/layouts/
  exists test/functional/

```

dependency model  
exists app/models/  
exists test/unit/  
exists test/fixtures/  
identical app/models/legacy.rb  
identical test/unit/legacy\_test.rb  
identical test/fixtures/legacies.yml  
error Before updating scaffolding from new DB schema, try  
creating a table for your model (Legacy)

[http://localhost:3000/legacies/list](http://localhost:3000/legacies/list)  
[http://localhost:3000/legacy/list](http://localhost:3000/legacy/list)

=\> Booting WEBrick…  
=\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Ctrl-C to shutdown server; call with --help for options  
[2007-06-18 04:06:02] INFO WEBrick 1.3.1  
[2007-06-18 04:06:02] INFO ruby 1.8.5 (2007-03-13) [i386-linux]  
[2007-06-18 04:06:02] INFO WEBrick::HTTPServer#start: pid=5300  
port=3000  
127.0.0.1 - - [18/Jun/2007:04:06:06 BST] “GET /legacy/list HTTP/1.1” 404  
625

- → /legacy/list  
127.0.0.1 - - [18/Jun/2007:04:06:11 BST] “GET /legacy/list HTTP/1.1” 404  
625
- → /legacy/list  
[2007-06-18 04:06:14] INFO going to shutdown …  
[2007-06-18 04:06:14] INFO WEBrick::HTTPServer#start done.  
[thufir@localhost ~]$  
[thufir@localhost ~]$

thanks,

Thufir

---

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [June 25, 2007, 9:34pm UTC](https://www.ruby-forum.com/t/try-creating-a-table-for-your-model-legacy/107733/2 "2007-06-25T21:34:34Z")

</div>

Hi Thufir,

Thufir wrote:

> what’s meant by the error message “error Before updating scaffolding  
> from new DB schema, try creating a table for your model (Legacy)”? Is  
> this why I can’t get a list view of the table?
> 
> From googling on this code, pardon, it’s not clear to me what the issue  
> is. Isn’t the table name correct?
> 
> here’s my bash script, which does all the ruby on rails, and it’s results:

> mysql\> use legacy;  
>   
> ±-----------------+  
> | Tables\_in\_legacy |  
> ±-----------------+  
> | legacies |

This is just a guess, but it might be that Rails’ is having trouble  
reflecting on a situation where the table name is the same as the model  
name. If so, I’d call it a bug.

Best regards,  
Bill
