feat: ✨ make the website load for different subdomains
This commit is contained in:
parent
f00e97d294
commit
d39595d577
4 changed files with 80 additions and 54 deletions
|
@ -6,6 +6,7 @@ USE dragon_fire;
|
|||
CREATE TABLE posts (
|
||||
post_id INTEGER AUTO_INCREMENT,
|
||||
|
||||
host VARCHAR(64) NOT NULL,
|
||||
post_path VARCHAR(255) NOT NULL,
|
||||
post_path_depth INTEGER NOT NULL DEFAULT 0,
|
||||
|
||||
|
@ -20,9 +21,9 @@ CREATE TABLE posts (
|
|||
post_content MEDIUMTEXT,
|
||||
|
||||
PRIMARY KEY(post_id),
|
||||
CONSTRAINT unique_post_path UNIQUE (post_path),
|
||||
CONSTRAINT unique_post UNIQUE (host, post_path),
|
||||
|
||||
INDEX(post_path),
|
||||
INDEX(host, post_path),
|
||||
INDEX(post_path_depth, post_path),
|
||||
INDEX(post_create_time),
|
||||
INDEX(post_update_time)
|
||||
|
@ -30,6 +31,7 @@ CREATE TABLE posts (
|
|||
|
||||
CREATE TABLE path_access_counts (
|
||||
access_time DATETIME NOT NULL,
|
||||
host VARCHAR(64) NOT NULL,
|
||||
post_path VARCHAR(255),
|
||||
agent VARCHAR(255),
|
||||
referrer VARCHAR(255),
|
||||
|
@ -37,10 +39,11 @@ CREATE TABLE path_access_counts (
|
|||
path_access_count INTEGER DEFAULT 0,
|
||||
path_processing_time DOUBLE PRECISION DEFAULT 0,
|
||||
|
||||
PRIMARY KEY(access_time, post_path, agent, referrer)
|
||||
PRIMARY KEY(access_time, host, post_path, agent, referrer)
|
||||
);
|
||||
|
||||
CREATE TABLE feed_cache (
|
||||
host VARCHAR(64) NOT NULL,
|
||||
search_path VARCHAR(255),
|
||||
export_type VARCHAR(255),
|
||||
|
||||
|
@ -48,7 +51,7 @@ CREATE TABLE feed_cache (
|
|||
|
||||
feed_content MEDIUMTEXT,
|
||||
|
||||
PRIMARY KEY(search_path, export_type)
|
||||
PRIMARY KEY(host, search_path, export_type)
|
||||
);
|
||||
|
||||
INSERT INTO posts (post_path, post_path_depth, post_metadata, post_content)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue