Skip to content

Commit

Permalink
Update example.py
Browse files Browse the repository at this point in the history
  • Loading branch information
amber-moe authored Apr 26, 2024
1 parent 17ff8b9 commit 1c41106
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions python/mysql-connector-python/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -41,7 +33,7 @@
FileSummary TEXT,
FileKeywords TEXT,
FileContent MEDIUMTEXT,
FilePurpose VARCHAR(255),
FilePurpose VARCHAR(255)
);
"""
# 执行创建表的 SQL 语句
Expand Down

0 comments on commit 1c41106

Please sign in to comment.