# Before updating scaffolding from new DB schema, try creating

**URL:** <https://www.ruby-forum.com/t/before-updating-scaffolding-from-new-db-schema-try-creating/107106>\
**Category:** Rails\
**Created:** [June 18, 2007, 6:56am UTC](https://www.ruby-forum.com/t/before-updating-scaffolding-from-new-db-schema-try-creating/107106 "2007-06-18T06:56:57Z")\
**Posts on this page:** 4\
**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 18, 2007, 6:56am UTC](https://www.ruby-forum.com/t/before-updating-scaffolding-from-new-db-schema-try-creating/107106/1 "2007-06-18T06:56:57Z")

</div>

What does the message “error Before updating scaffolding from new DB  
schema, try creating a table for your model (Legacy)” mean? My  
googling shows that others have received similar messages, but it’s  
not clear to me the import of the message.

Here’s what I’m doing which generates this error:

[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 ~]$

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 18, 2007, 3:01pm UTC](https://www.ruby-forum.com/t/before-updating-scaffolding-from-new-db-schema-try-creating/107106/2 "2007-06-18T15:01:02Z")

</div>

Thufir,

“error Before updating scaffolding from new DB  
schema, try creating a table for your model (Legacy)”

It sounds like your model hasn’t got a table. Is it looking for  
‘Legacies’? with capital L.

Xin

---

<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 18, 2007, 9:32pm UTC](https://www.ruby-forum.com/t/before-updating-scaffolding-from-new-db-schema-try-creating/107106/3 "2007-06-18T21:32:09Z")

</div>

On Jun 18, 6:01 am, Xin Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Thufir,
> 
> “error Before updating scaffolding from new DB  
> schema, try creating a table for your model (Legacy)”
> 
> It sounds like your model hasn’t got a table. Is it looking for  
> ‘Legacies’? with capital L.
> 
> Xin

model means database schema? MySQL shows a table with a small “l” ☹

or, model means something in ruby?

thanks,

Thufir (not at home)

---

<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 19, 2007, 3:15pm UTC](https://www.ruby-forum.com/t/before-updating-scaffolding-from-new-db-schema-try-creating/107106/4 "2007-06-19T15:15:47Z")

</div>

On Jun 18, 2:01 pm, Xin Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:  
[…]

> It sounds like your model hasn’t got a table. Is it looking for  
> ‘Legacies’? with capital L.  
> […]

Changed the schema, and the database.yml file, same result:

[thufir@localhost ~]$ ./ruby.legacy.txt

Tue Jun 19 14:10:57 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: Legacy  
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: Legacy  
username: feeds  
password: password  
socket: /var/lib/mysql/mysql.sock

production:  
adapter: mysql  
database: Legacy  
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-19 14:11:33] INFO WEBrick 1.3.1  
[2007-06-19 14:11:33] INFO ruby 1.8.5 (2007-03-13) [i386-linux]  
[2007-06-19 14:11:33] INFO WEBrick::HTTPServer#start: pid=7950  
port=3000  
[2007-06-19 14:11:41] INFO going to shutdown …  
[2007-06-19 14:11:41] INFO WEBrick::HTTPServer#start done.  
[thufir@localhost ~]$  
[thufir@localhost ~]$ mysql -u feeds -p  
Enter password:  
Welcome to the MySQL monitor. Commands end with ; or \g.  
Your MySQL connection id is 25 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.03 sec)

mysql\> quit  
Bye  
[thufir@localhost ~]$  
[thufir@localhost ~]$ date  
Tue Jun 19 14:12:14 BST 2007  
[thufir@localhost ~]$  
[thufir@localhost ~]$

thanks,

Thufir
