Skip to content
Myr

schema.rst

This file

Path

docs/tutorial/schema.rst

25 lines · 806 bytes

Last changed by

Address #1902: Converts example/flaskr to have a setup.py (#1945)Kyle Lawlorbefore adoption17d4cb3

History of this file

Take it

The walk stopped after 200 commits: lines older than 7169f44 point at it.

Various fixes for test runningMarkus Unterwaditzerbefore adoption7169f44

lines 1–5why, one step back
1.. _tutorial-schema:
23Step 1: Database Schema4=======================5

Address #1902: Converts example/flaskr to have a setup.py (#1945)Kyle Lawlorbefore adoption17d4cb3

lines 6–9why, one step back
6In this step, you will create the database schema. Only a single table is
7needed for this application and it will only support SQLite. All you need to do8is put the following contents into a file named :file:`schema.sql` in the9:file:`flaskr/flaskr` folder:

Various fixes for test runningMarkus Unterwaditzerbefore adoption7169f44

lines 10–19why, one step back
10
11.. sourcecode:: sql1213 drop table if exists entries;14 create table entries (15 id integer primary key autoincrement,16 title text not null,17 'text' text not null18 );19

Address #1902: Converts example/flaskr to have a setup.py (#1945)Kyle Lawlorbefore adoption17d4cb3

line 20why, one step back
20This schema consists of a single table called ``entries``. Each row in

Merge pull request #1277 from iKevinY/doc-fixesMarkus Unterwaditzerbefore adoption82d7c49

line 21why, one step back
21this table has an ``id``, a ``title``, and a ``text``. The ``id`` is an

Various fixes for test runningMarkus Unterwaditzerbefore adoption7169f44

lines 22–25why, one step back
22automatically incrementing integer and a primary key, the other two are
23strings that must not be null.2425Continue with :ref:`tutorial-setup`.