diff --git a/database/ydb/examples/migrations/003_create_topic.down.sql b/database/ydb/examples/migrations/003_create_topic.down.sql index c73aaf379..829f1266d 100644 --- a/database/ydb/examples/migrations/003_create_topic.down.sql +++ b/database/ydb/examples/migrations/003_create_topic.down.sql @@ -1 +1 @@ -DROP TOPIC `test/topic`; +DROP TOPIC IF EXISTS `test/topic`; diff --git a/database/ydb/examples/migrations/004_add_index_on_user_emails.down.sql b/database/ydb/examples/migrations/004_add_index_on_user_emails.down.sql new file mode 100644 index 000000000..09ee4edd7 --- /dev/null +++ b/database/ydb/examples/migrations/004_add_index_on_user_emails.down.sql @@ -0,0 +1 @@ +ALTER TABLE `test/users` DROP INDEX `users_email_index`; diff --git a/database/ydb/examples/migrations/004_add_index_on_user_emails.up.sql b/database/ydb/examples/migrations/004_add_index_on_user_emails.up.sql new file mode 100644 index 000000000..f6a76017d --- /dev/null +++ b/database/ydb/examples/migrations/004_add_index_on_user_emails.up.sql @@ -0,0 +1 @@ +ALTER TABLE `test/users` ADD INDEX `users_email_index` GLOBAL UNIQUE ON (`email`); diff --git a/database/ydb/examples/migrations/005_create_books_table.down.sql b/database/ydb/examples/migrations/005_create_books_table.down.sql new file mode 100644 index 000000000..05e926808 --- /dev/null +++ b/database/ydb/examples/migrations/005_create_books_table.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS `test/books`; diff --git a/database/ydb/examples/migrations/005_create_books_table.up.sql b/database/ydb/examples/migrations/005_create_books_table.up.sql new file mode 100644 index 000000000..3adc7b076 --- /dev/null +++ b/database/ydb/examples/migrations/005_create_books_table.up.sql @@ -0,0 +1,6 @@ +CREATE TABLE `test/books` ( + user_id Uint64, + name Text, + author Text, + PRIMARY KEY (user_id) +); diff --git a/database/ydb/examples/migrations/006_create_movies_table.down.sql b/database/ydb/examples/migrations/006_create_movies_table.down.sql new file mode 100644 index 000000000..7f361b35a --- /dev/null +++ b/database/ydb/examples/migrations/006_create_movies_table.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS `test/movies`; diff --git a/database/ydb/examples/migrations/006_create_movies_table.up.sql b/database/ydb/examples/migrations/006_create_movies_table.up.sql new file mode 100644 index 000000000..6aa837f51 --- /dev/null +++ b/database/ydb/examples/migrations/006_create_movies_table.up.sql @@ -0,0 +1,6 @@ +CREATE TABLE `test/movies` ( + user_id Uint64, + name Text, + director Text, + PRIMARY KEY (user_id) +);