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
The walk stopped after 200 commits: lines older than 148c50a point at it.
Document url_for BuildError hook.Ron DuPlainbefore adoption148c50a
lines 1–5why, one step back1.. _tutorial-schema:23Step 1: Database Schema4=======================5Changed the wording of some sentences there were difficult to understand.Reetta Vaahtorantabefore adoption0d648fa
lines 6–7why, one step back6First 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:Document url_for BuildError hook.Ron DuPlainbefore adoption148c50a
lines 8–13why, one step back89.. sourcecode:: sql1011 drop table if exists entries;12 create table entries (13 id integer primary key autoincrement,Merge pull request #655 from oliversong/masterArmin Ronacherbefore adoptionab3d9d1
lines 14–15why, one step back14 title text not null,15 text text not nullDocument url_for BuildError hook.Ron DuPlainbefore adoption148c50a
lines 16–23why, one step back16 );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`.