From 1c41106089fe953c9dcdf9b2f211283dbeb625ea Mon Sep 17 00:00:00 2001 From: Amber Moe <42762957+Amber1990Zhang@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:37:41 +0800 Subject: [PATCH] Update example.py --- python/mysql-connector-python/example.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/python/mysql-connector-python/example.py b/python/mysql-connector-python/example.py index 1e290c7..5791999 100644 --- a/python/mysql-connector-python/example.py +++ b/python/mysql-connector-python/example.py @@ -24,15 +24,7 @@ cnx = mysql.connector.connect(**db_config) cursor = cnx.cursor() -# 创建 Products 表和 ProductFiles 表 -create_products_table = """ -CREATE TABLE IF NOT EXISTS Products ( - ProductID INT AUTO_INCREMENT PRIMARY KEY, - ProductName VARCHAR(255) NOT NULL, - ProductVersion VARCHAR(50) NOT NULL, - UNIQUE (ProductName, ProductVersion) -); -""" +# 创建 ProductFiles 表 create_productfiles_table = """ CREATE TABLE IF NOT EXISTS ProductFiles ( FileID INT AUTO_INCREMENT PRIMARY KEY, @@ -41,7 +33,7 @@ FileSummary TEXT, FileKeywords TEXT, FileContent MEDIUMTEXT, - FilePurpose VARCHAR(255), + FilePurpose VARCHAR(255) ); """ # 执行创建表的 SQL 语句