发布于 2015-08-24 16:03:59 | 496 次阅读 | 评论: 0 | 来源: 网络整理

步骤 1 :数据库模式

首先我们要创建数据库模式。本应用只需要使用一张表,并且由于我们使用 SQLite , 所以这一步非常简单。把以下内容保存为 schema.sql 文件并放在我们上一步创建的 flaskr 文件夹中就行了:

drop table if exists entries;
create table entries (
  id integer primary key autoincrement,
  title text not null,
  text text not null
);

这个模式只有一张名为 entries 的表,表中的字段为 idtitletextid 是主键,是自增整数型字段,另外两个字段是非空的字符串型字段。

下面请阅读 步骤 2 :应用构建代码

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务