# python_flask_site_blog **Repository Path**: antianshi/python_flask_site_blog ## Basic Information - **Project Name**: python_flask_site_blog - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-12-06 - **Last Updated**: 2021-12-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 需求分析 个人博客,有管理页面,没有用户登录、注册。访客可评论。 # 数据模型 文章表: ```mysql CREATE TABLE articles( `id` INT PRIMARY KEY auto_increment, `created` TIMESTAMP DEFAULT current_timestamp, `updated` TIMESTAMP DEFAULT current_timestamp, `deleted` TINYINT DEFAULT 0, `draft` TINYINT DEFAULT 0, `disable` tinyint DEFAULT '0', `title` VARCHAR(255) NOT NULL, `desc` TEXT, `content` LONGTEXT NOT NULL, `view` INT DEFAULT 0, `comment` INT DEFAULT 0 ); ``` 评论表: ```mysql CREATE TABLE comments( `id` INT PRIMARY KEY auto_increment, `f_id` INT DEFAULT NULL, `created` TIMESTAMP DEFAULT current_timestamp, `updated` TIMESTAMP DEFAULT current_timestamp, `deleted` TINYINT DEFAULT 0, `disable` tinyint DEFAULT '0', `article_id` INT DEFAULT NULL, `nickname` VARCHAR(255) NOT NULL, `email` VARCHAR(120) NOT NULL, `url` VARCHAR(255) DEFAULT "#", `body` TEXT NOT NULL, CONSTRAINT comments_articles FOREIGN KEY (article_id) REFERENCES articles(id) ON UPDATE CASCADE ); ``` 友链表: ```mysql CREATE TABLE links( `id` INT PRIMARY KEY AUTO_INCREMENT, `created` TIMESTAMP DEFAULT current_timestamp, `updated` TIMESTAMP DEFAULT current_timestamp, `deleted` TINYINT DEFAULT 0, `email` VARCHAR(120) NOT NULL, `site_name` VARCHAR(50) NOT NULL, `site_desc` VARCHAR(120) NOT NULL, `site_url` VARCHAR(50) NOT NULL, `site_img_url` VARCHAR(50) NOT NULL ); ``` 管理员表: ```mysql CREATE TABLE admins( `id` INT PRIMARY KEY AUTO_INCREMENT, `created` TIMESTAMP DEFAULT current_timestamp, `updated` TIMESTAMP DEFAULT current_timestamp, `deleted` TINYINT DEFAULT 0, `email` VARCHAR(120) NOT NULL, `password` VARCHAR(255) NOT NULL ); ``` 图片上传表: ```mysql CREATE TABLE images( `id` INT PRIMARY KEY AUTO_INCREMENT, `created` TIMESTAMP DEFAULT current_timestamp, `updated` TIMESTAMP DEFAULT current_timestamp, `deleted` TINYINT DEFAULT 0, `url` VARCHAR(120) NOT NULL, `desc` VARCHAR(255) ); ``` 视频表: ```mysql CREATE TABLE videos( `id` INT PRIMARY KEY AUTO_INCREMENT, `created` TIMESTAMP DEFAULT current_timestamp, `updated` TIMESTAMP DEFAULT current_timestamp, `deleted` TINYINT DEFAULT 0, `url` VARCHAR(120) NOT NULL, `desc` VARCHAR(255) ); ```