Skip to content

Commit

Permalink
tests: remove fks test for sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
luantranminh committed Jun 2, 2024
1 parent 22dc078 commit 6ffefd4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion gormschema/gorm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
func TestSQLiteConfig(t *testing.T) {
resetSession()
l := gormschema.New("sqlite")
sql, err := l.Load(models.WorkingAgedUsers{}, models.Pet{}, models.User{}, ckmodels.Event{}, ckmodels.Location{}, models.TopPetOwner{})
sql, err := l.Load(models.WorkingAgedUsers{}, models.Pet{}, ckmodels.Event{}, ckmodels.Location{}, models.TopPetOwner{})
require.NoError(t, err)
requireEqualContent(t, sql, "testdata/sqlite_default")
resetSession()
Expand Down
2 changes: 0 additions & 2 deletions gormschema/testdata/sqlite_default
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ CREATE TABLE `users` (`id` integer,`created_at` datetime,`updated_at` datetime,`
CREATE INDEX `idx_users_deleted_at` ON `users`(`deleted_at`);
CREATE TABLE `pets` (`id` integer,`created_at` datetime,`updated_at` datetime,`deleted_at` datetime,`name` text,`user_id` integer,PRIMARY KEY (`id`),CONSTRAINT `fk_users_pets` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`));
CREATE INDEX `idx_pets_deleted_at` ON `pets`(`deleted_at`);
CREATE TABLE `hobbies` (`id` integer,`name` text,PRIMARY KEY (`id`));
CREATE TABLE `user_hobbies` (`hobby_id` integer,`user_id` integer,PRIMARY KEY (`hobby_id`,`user_id`),CONSTRAINT `fk_user_hobbies_hobby` FOREIGN KEY (`hobby_id`) REFERENCES `hobbies`(`id`),CONSTRAINT `fk_user_hobbies_user` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`));
CREATE TABLE `locations` (`locationId` text,`eventId` text,PRIMARY KEY (`locationId`),CONSTRAINT `fk_events_location` FOREIGN KEY (`eventId`) REFERENCES `events`(`eventId`));
CREATE UNIQUE INDEX `idx_locations_event_id` ON `locations`(`eventId`);
CREATE TABLE `events` (`eventId` text,`locationId` text,PRIMARY KEY (`eventId`),CONSTRAINT `fk_locations_event` FOREIGN KEY (`locationId`) REFERENCES `locations`(`locationId`));
Expand Down

0 comments on commit 6ffefd4

Please sign in to comment.