Skip to content

Commit 00eb54b

Browse files
committed
mds6_rdd_dags dz7_v6
1 parent 6ddcf94 commit 00eb54b

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

dags/rdd/dz7.py

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,20 @@
4343

4444
# Завдання для створення таблиці (якщо не існує)
4545
create_table = MySqlOperator(
46-
task_id='create_table',
47-
mysql_conn_id=connection_name,
48-
sql="""
49-
CREATE TABLE IF NOT EXISTS mds6rdd.games (
50-
`edition` text,
51-
`edition_id` int DEFAULT NULL,
52-
`edition_url` text,
53-
`year` int DEFAULT NULL,
54-
`city` text,
55-
`country_flag_url` text,
56-
`country_noc` text,
57-
`start_date` text,
58-
`end_date` text,
59-
`competition_date` text,
60-
`isHeld` text
61-
);
62-
"""
63-
)
46+
task_id='create_table',
47+
mysql_conn_id=connection_name,
48+
sql="""
49+
DROP TABLE IF EXISTS mds6rdd.medals;
50+
51+
CREATE TABLE IF NOT EXISTS mds6rdd.medals (
52+
`id` INT NOT NULL AUTO_INCREMENT,
53+
`medal_type` VARCHAR(50),
54+
`count` INT,
55+
`created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
56+
PRIMARY KEY (`id`)
57+
);
58+
"""
59+
)
6460

6561
check_db = MySqlOperator(
6662
task_id='check_db',

0 commit comments

Comments
 (0)