Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 26 lines (19 sloc) 0.825 kb
9d19b77 Armin Ronacher Added lazyloading pattern and explicit chapter links in tutorial.
authored
1 .. _tutorial-schema:
2
bcf347f Armin Ronacher New style for the documentation. Looks more like the website now.
authored
3 Step 1: Database Schema
4 =======================
5
23fc2e5 Kevin Yap Grammatical fixes in Foreword and Tutorial
iKevinY authored
6 First, we want to create the database schema. Only a single table is needed
7 for this application and we only want to support SQLite, so creating the
afd3c45 Armin Ronacher Rewrapped lines
authored
8 database schema is quite easy. Just put the following contents into a file
9 named `schema.sql` in the just created `flaskr` folder:
bcf347f Armin Ronacher New style for the documentation. Looks more like the website now.
authored
10
11 .. sourcecode:: sql
12
13 drop table if exists entries;
14 create table entries (
15 id integer primary key autoincrement,
cc82feb Oliver Song Changing string to text in schema files
oliversong authored
16 title text not null,
2d992e7 root-11 Update schema.rst
root-11 authored
17 'text' text not null
bcf347f Armin Ronacher New style for the documentation. Looks more like the website now.
authored
18 );
19
23fc2e5 Kevin Yap Grammatical fixes in Foreword and Tutorial
iKevinY authored
20 This schema consists of a single table called ``entries``. Each row in
21 this table has an ``id``, a ``title``, and a ``text``. The ``id`` is an
bcf347f Armin Ronacher New style for the documentation. Looks more like the website now.
authored
22 automatically incrementing integer and a primary key, the other two are
23 strings that must not be null.
9d19b77 Armin Ronacher Added lazyloading pattern and explicit chapter links in tutorial.
authored
24
25 Continue with :ref:`tutorial-setup`.
Something went wrong with that request. Please try again.