From 05aed570b2054d225a75ab767c177fab09c4c2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E7=8E=A5?= <10175501108@stu.ecnu.edu.cn> Date: Tue, 12 Jan 2021 11:23:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'init.sql'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.sql | 78 +++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/init.sql b/init.sql index c7f2255..5e22982 100644 --- a/init.sql +++ b/init.sql @@ -1,38 +1,40 @@ -## 代码结构 - --- app2 - - -- im2latex_master OCR模型 - - --php,js文件 - - Dockerfile - - - -## 部署运行方式: - -方式一:直接用docker部署 - -1. 申请ucloud云主机 - -2. 在云主机上使用容器部署ngnix,php,python环境 - -```shell -docker build -t wangziyue/php-ngnix-python . -docker run -d --rm -v /var/app2/:/app/ -p 80:80 --privileged=true --name php-nginx-python wangziyue/php-ngnix-python:v2 - -``` - -3. 申请ucloud的云数据库,修改pdo.php中数据库地址 -4. 在云数据库中运行init.sql -5. 访问 id:/index.php - - - - - - - -## SaaS应用效果截图: - +GRANT ALL ON blog.* TO 'root'@'%' IDENTIFIED BY 'a15862340183'; +CREATE DATABASE blog DEFAULT CHARACTER SET utf8; +CREATE TABLE users ( + user_id INT UNSIGNED NOT NULL AUTO_INCREMENT , + + password VARCHAR(128) NOT NULL , + name VARCHAR(255) NOT NULL , + PRIMARY KEY(user_id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + + CREATE TABLE article ( + article_id INT UNSIGNED NOT NULL AUTO_INCREMENT , + user_id INT UNSIGNED NOT NULL, + headline TEXT, + content TEXT, + viewer INT UNSIGNED , + public varchar(11), + category varchar(128), + PRIMARY KEY(article_id), + + CONSTRAINT articc_ibfk_1 + FOREIGN KEY (user_id) + REFERENCES users (user_id) + ON DELETE CASCADE ON UPDATE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + + CREATE TABLE commentsss ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT , + comment_id INT UNSIGNED NOT NULL, + feedback_id INT UNSIGNED , + name VARCHAR(128), + user_id INTEGER, + article_id INT UNSIGNED, + content TEXT, + PRIMARY KEY(id), + CONSTRAINT articcc_ibfk_1 + FOREIGN KEY (article_id) + REFERENCES article (article_id) + ON DELETE CASCADE ON UPDATE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8;