feat: ✨ added first draft of Database based website rendering
Some checks failed
/ phplint (push) Failing after 3s
Some checks failed
/ phplint (push) Failing after 3s
This commit is contained in:
parent
5bcba0b689
commit
fcc42bde20
4 changed files with 171 additions and 23 deletions
|
@ -9,40 +9,103 @@ CREATE TABLE posts (
|
|||
post_path VARCHAR(255) NOT NULL,
|
||||
post_path_depth INTEGER NOT NULL DEFAULT 0,
|
||||
|
||||
post_title TEXT,
|
||||
post_description TEXT,
|
||||
post_brief TEXT,
|
||||
post_create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
post_update_time DATETIME NOT NULL
|
||||
DEFAULT CURRENT_TIMESTAMP
|
||||
ON UPDATE CURRENT_TIMESTAMP,
|
||||
|
||||
post_metadata JSON NOT NULL,
|
||||
|
||||
post_content MEDIUMTEXT,
|
||||
post_content_type TEXT,
|
||||
|
||||
PRIMARY KEY(post_id),
|
||||
CONSTRAINT unique_post_path UNIQUE (post_path),
|
||||
|
||||
INDEX(post_path),
|
||||
INDEX(post_path, post_update_time),
|
||||
INDEX(post_path, post_create_time),
|
||||
INDEX(post_path_depth, post_path)
|
||||
);
|
||||
|
||||
CREATE TABLE post_tags (
|
||||
post_id INTEGER,
|
||||
tag VARCHAR(255),
|
||||
|
||||
CONSTRAINT post_fkey
|
||||
FOREIGN KEY(post_id) REFERENCES posts(post_id)
|
||||
ON DELETE CASCADE,
|
||||
|
||||
INDEX(post_id),
|
||||
INDEX(tag)
|
||||
);
|
||||
|
||||
|
||||
INSERT INTO posts (post_path, post_title, post_content)
|
||||
INSERT INTO posts (post_path, post_path_depth, post_metadata, post_content)
|
||||
VALUES (
|
||||
'/about',
|
||||
'About the Dergs',
|
||||
0,
|
||||
'
|
||||
{
|
||||
"tags": ["test", "test2", "hellorld"],
|
||||
"brief": "This is a simple test indeed",
|
||||
"type": "text/markdown",
|
||||
"title": "About the dergen"
|
||||
}
|
||||
',
|
||||
'
|
||||
# About the dergs indeed
|
||||
|
||||
This is just a simple test. Might be nice, though!
|
||||
'
|
||||
), (
|
||||
'/about/neira',
|
||||
1,
|
||||
'
|
||||
{
|
||||
"tags": ["test", "test2", "hellorld", "neira"],
|
||||
"brief": "This is a soft grab of Neira",
|
||||
"type": "text/markdown",
|
||||
"title": "About her"
|
||||
}
|
||||
',
|
||||
'
|
||||
# Nothing here yet!
|
||||
|
||||
Sorry for this. She is working hard :>
|
||||
'
|
||||
), (
|
||||
'/about/xasin',
|
||||
1,
|
||||
'
|
||||
{
|
||||
"tags": ["test", "test2", "hellorld", "xasin"],
|
||||
"brief": "This is a soft grab of Xasin",
|
||||
"type": "text/markdown",
|
||||
"title": "About her"
|
||||
}
|
||||
',
|
||||
'
|
||||
# Nothing here yet!
|
||||
|
||||
Sorry for this. He is working hard :>
|
||||
'
|
||||
), (
|
||||
'/about/mesh',
|
||||
1,
|
||||
'
|
||||
{
|
||||
"tags": ["test", "test2", "hellorld", "mesh"],
|
||||
"brief": "This is a soft grab of Mesh",
|
||||
"type": "text/markdown",
|
||||
"title": "About her"
|
||||
}
|
||||
',
|
||||
'
|
||||
# Nothing here yet!
|
||||
|
||||
Sorry for this. Shi is working hard :>
|
||||
'
|
||||
), (
|
||||
'/about/alviere',
|
||||
1,
|
||||
'
|
||||
{
|
||||
"tags": ["test", "test2", "hellorld", "mesh"],
|
||||
"brief": "SHE GRABS",
|
||||
"type": "text/markdown",
|
||||
"title": "SHE GRABS"
|
||||
}
|
||||
',
|
||||
'
|
||||
# Nothing here yet!
|
||||
|
||||
Sorry for this. She GRABS A LOT
|
||||
'
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue