Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

What is the file tutorial.sql for ?

Hello,

I read that "the database table should be created outside of Phalcon". Ok, I understand that create databases and create tables is not phalcon's job. May be the phalcon devtools's job, I think.

What is the file tutorial.sql for ? (see in the basic tutorial)

Thanks !



608
Accepted
answer

Ok, I can import a table in my base, table which is described with a .sql : "SOURCE Memo.sql;"

For example :

mirmaou #

mirmaou # mysql -u root -p

Welcome to the MySQL monitor. Commands end with ; or \g.

...

mysql>

mysql> SHOW DATABASES;

+--------------------+

| Database |

+--------------------+

| mysql |

| symfony |

| sys |

+--------------------+

mysql> CREATE DATABASE Memory;

mysql> SHOW DATABASES;

+--------------------+

| Database |

+--------------------+

| Memory |

| mysql |

| symfony |

| sys |

+--------------------+

mysql> USE Memory

Database changed

mysql> SOURCE Memo.sql;

mysql> SHOW TABLES;

+------------------+

| Tables_in_Memory |

+------------------+

| Utilisateurs |

+------------------+

mysql> DESCRIBE Utilisateurs;

+-------+------------------+------+-----+---------+----------------+

| Field | Type | Null | Key | Default | Extra |

+-------+------------------+------+-----+---------+----------------+

| id | int(10) unsigned | NO | PRI | NULL | auto_increment |

| nom | varchar(70) | NO | | NULL | |

| email | varchar(70) | NO | | NULL | |

+-------+------------------+------+-----+---------+----------------+

It's best when it's said...