github.com/iasthc/atlas/cmd/atlas@v0.0.0-20230523071841-73246df3f88d/internal/cmdapi/testdata/sqlitetx/20220925094437_third.sql (about)

     1  -- disable the enforcement of foreign-keys constraints
     2  PRAGMA foreign_keys = off;
     3  -- create "new_users" table
     4  CREATE TABLE `new_users` (`id` integer NOT NULL, PRIMARY KEY (`id`));
     5  -- copy rows from old table "users" to new temporary table "new_users"
     6  INSERT INTO `new_users` (`id`) SELECT `id` FROM `users`;
     7  -- drop "users" table after copying rows
     8  DROP TABLE `users`;
     9  -- rename temporary table "new_users" to "users"
    10  ALTER TABLE `new_users` RENAME TO `users`;
    11  -- enable back the enforcement of foreign-keys constraints
    12  PRAGMA foreign_keys = on;