schema.rst
This file
Path
docs/tutorial/schema.rst
25 lines · 825 bytes
Last changed by
Merge pull request #1277 from iKevinY/doc-fixesMarkus Unterwaditzerbefore adoption82d7c49
History of this fileTake it
The walk stopped after 200 commits: lines older than d4f8634 point at it.
Merge pull request #899 from pengfei-xue/masterDaniel Neuhäuserbefore adoptiond4f8634
lines 1–5why, one step back1.. _tutorial-schema:23Step 1: Database Schema4=======================5Merge pull request #1277 from iKevinY/doc-fixesMarkus Unterwaditzerbefore adoption82d7c49
lines 6–7why, one step back6First, we want to create the database schema. Only a single table is needed7for this application and we only want to support SQLite, so creating theRewrapped linesArmin Ronacherbefore adoptionafd3c45
lines 8–9why, one step back8database schema is quite easy. Just put the following contents into a file9named `schema.sql` in the just created `flaskr` folder:Merge pull request #899 from pengfei-xue/masterDaniel Neuhäuserbefore adoptiond4f8634
lines 10–16why, one step back1011.. sourcecode:: sql1213 drop table if exists entries;14 create table entries (15 id integer primary key autoincrement,16 title text not null,Merge pull request #1099 from root-11/patch-1Daniel Neuhäuserbefore adoptionf6618c7
line 17why, one step back17 'text' text not nullMerge pull request #899 from pengfei-xue/masterDaniel Neuhäuserbefore adoptiond4f8634
lines 18–19why, one step back18 );19Merge pull request #1277 from iKevinY/doc-fixesMarkus Unterwaditzerbefore adoption82d7c49
lines 20–21why, one step back20This schema consists of a single table called ``entries``. Each row in21this table has an ``id``, a ``title``, and a ``text``. The ``id`` is anMerge pull request #899 from pengfei-xue/masterDaniel Neuhäuserbefore adoptiond4f8634
lines 22–25why, one step back22automatically incrementing integer and a primary key, the other two are23strings that must not be null.2425Continue with :ref:`tutorial-setup`.