# Making tables with SQLight

**URL:** <https://www.ruby-forum.com/t/making-tables-with-sqlight/82764>\
**Category:** Rails\
**Created:** [January 20, 2007, 4:54pm UTC](https://www.ruby-forum.com/t/making-tables-with-sqlight/82764 "2007-01-20T16:54:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmcfarland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/858c86/32.png) [@cmcfarland](https://www.ruby-forum.com/u/cmcfarland)\
**Post date:** [January 20, 2007, 4:54pm UTC](https://www.ruby-forum.com/t/making-tables-with-sqlight/82764/1 "2007-01-20T16:54:45Z")

</div>

Hi, Im using locomotive and running SQLight. Im confused about making  
tables with sqlight.

Im following the depot example from ‘agile web development with rails’.  
When trying to make the table ‘products’ is there a difference when  
using SQLight rather than MySQL?

Here is the DDL for MySQL, how do I make this table with SQLight?

- 

drop table if exists products;  
create table products (  
id int not null auto\_increment,  
title varchar(100) not null,  
description text not null,  
image\_url varchar(200) not null,  
price decimal(10,2) not null,  
primary key (id)  
);

- 

Also am I right in thinking this should go directly into my  
addproductstable?

Basically if someone can explain to me the steps I need to do to make  
tables in SQLight!

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![cmcfarland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/858c86/32.png) [@cmcfarland](https://www.ruby-forum.com/u/cmcfarland)\
**Post date:** [January 20, 2007, 5:45pm UTC](https://www.ruby-forum.com/t/making-tables-with-sqlight/82764/2 "2007-01-20T17:45:50Z")

</div>

if you were to use rails migrations you wouldn’t have to worry about  
it database specific language.

Chris

---

<div class="post-metadata">

**Author:** ![cmcfarland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/858c86/32.png) [@cmcfarland](https://www.ruby-forum.com/u/cmcfarland)\
**Post date:** [January 20, 2007, 8:21pm UTC](https://www.ruby-forum.com/t/making-tables-with-sqlight/82764/3 "2007-01-20T20:21:15Z")

</div>

The first version of the agile book is very very outdated, rails hove  
along pretty fast.

Do migrations instead. Write the scremas in ruby and make rails deal  
with the sql.

[http://wiki.rubyonrails.com/rails/pages/UsingMigrations](http://wiki.rubyonrails.com/rails/pages/UsingMigrations)  
[http://wiki.rubyonrails.com/rails/pages/HowToUseMigrations](http://wiki.rubyonrails.com/rails/pages/HowToUseMigrations)  
[http://wiki.rubyonrails.com/rails/pages/UnderstandingMigrations](http://wiki.rubyonrails.com/rails/pages/UnderstandingMigrations)

---

<div class="post-metadata">

**Author:** ![cmcfarland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/858c86/32.png) [@cmcfarland](https://www.ruby-forum.com/u/cmcfarland)\
**Post date:** [January 22, 2007, 12:02pm UTC](https://www.ruby-forum.com/t/making-tables-with-sqlight/82764/4 "2007-01-22T12:02:06Z")

</div>

Thanks for your help. This is alot better!
