Initial import of sproutblog
This commit is contained in:
13
migrations/0001_init.sql
Normal file
13
migrations/0001_init.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
CREATE TABLE IF NOT EXISTS posts (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
title TEXT NOT NULL,
|
||||
slug TEXT NOT NULL UNIQUE,
|
||||
excerpt TEXT DEFAULT '',
|
||||
content TEXT NOT NULL,
|
||||
published INTEGER NOT NULL DEFAULT 1,
|
||||
created_at TEXT NOT NULL,
|
||||
updated_at TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_posts_published_updated_at
|
||||
ON posts (published, updated_at DESC);
|
||||
22
migrations/0002_seed_hello_world.sql
Normal file
22
migrations/0002_seed_hello_world.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
INSERT INTO posts (title, slug, excerpt, content, published, created_at, updated_at)
|
||||
VALUES (
|
||||
'Hello World',
|
||||
'hello-world',
|
||||
'第一篇测试文章。',
|
||||
'# Hello World
|
||||
|
||||
这是 SproutBlog 的第一篇文章。
|
||||
|
||||
它使用标准 Markdown 渲染,并且页面保持纯白、极简。
|
||||
|
||||
## 说明
|
||||
|
||||
- 这是一个示例段落
|
||||
- 这是一个示例列表
|
||||
|
||||
> 如果你看到这篇文章,说明 D1 和 Worker 已经正常工作。
|
||||
',
|
||||
1,
|
||||
datetime('now'),
|
||||
datetime('now')
|
||||
);
|
||||
Reference in New Issue
Block a user