schema.rst
This file
Path
docs/tutorial/schema.rst
23 lines · 815 bytes
Last changed by
Changed the wording of some sentences there were difficult to understand.Reetta Vaahtorantabefore adoption0d648fa
History of this fileTake it
1.. _tutorial-schema:23Step 1: Database Schema4=======================56First we want to create the database schema. Only a single table is needed 7for this application and we only want to support SQLite so creating the database schema is quite easy. Just put the following contents into a file named `schema.sql` in the just created `flaskr` folder:89.. sourcecode:: sql1011 drop table if exists entries;12 create table entries (13 id integer primary key autoincrement,14 title text not null,15 text text not null16 );1718This schema consists of a single table called `entries` and each row in19this table has an `id`, a `title` and a `text`. The `id` is an20automatically incrementing integer and a primary key, the other two are21strings that must not be null.2223Continue with :ref:`tutorial-setup`.