-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve rename_column SQLite behavior (#95)
* Add failing test case for rename_column * Improve rename_column SQLite behavior `ALTER TABLE .. RENAME COLUMN .. TO ..` is officially supported and does not need the temporary table workaround.
- Loading branch information
Showing
42 changed files
with
561 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
-- | ||
-- PostgreSQL database dump | ||
-- | ||
|
||
-- Dumped from database version 9.6.18 | ||
-- Dumped by pg_dump version 12.3 | ||
|
||
SET statement_timeout = 0; | ||
SET lock_timeout = 0; | ||
SET idle_in_transaction_session_timeout = 0; | ||
SET client_encoding = 'UTF8'; | ||
SET standard_conforming_strings = on; | ||
SELECT pg_catalog.set_config('search_path', '', false); | ||
SET check_function_bodies = false; | ||
SET xmloption = content; | ||
SET client_min_messages = warning; | ||
SET row_security = off; | ||
|
||
SET default_tablespace = ''; | ||
|
||
-- | ||
-- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE TABLE public.e2e_user_posts ( | ||
id uuid NOT NULL, | ||
user_id uuid NOT NULL, | ||
slug character varying(64) NOT NULL, | ||
notes character varying(255) | ||
); | ||
|
||
|
||
ALTER TABLE public.e2e_user_posts OWNER TO postgres; | ||
|
||
-- | ||
-- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE TABLE public.e2e_users ( | ||
id uuid NOT NULL, | ||
username character varying(255), | ||
created_at timestamp without time zone NOT NULL, | ||
updated_at timestamp without time zone NOT NULL | ||
); | ||
|
||
|
||
ALTER TABLE public.e2e_users OWNER TO postgres; | ||
|
||
-- | ||
-- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE TABLE public.schema_migration ( | ||
version character varying(14) NOT NULL | ||
); | ||
|
||
|
||
ALTER TABLE public.schema_migration OWNER TO postgres; | ||
|
||
-- | ||
-- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres | ||
-- | ||
|
||
ALTER TABLE ONLY public.e2e_user_posts | ||
ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); | ||
|
||
|
||
-- | ||
-- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres | ||
-- | ||
|
||
ALTER TABLE ONLY public.e2e_users | ||
ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); | ||
|
||
|
||
-- | ||
-- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); | ||
|
||
|
||
-- | ||
-- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); | ||
|
||
|
||
-- | ||
-- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); | ||
|
||
|
||
-- | ||
-- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres | ||
-- | ||
|
||
ALTER TABLE ONLY public.e2e_user_posts | ||
ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; | ||
|
||
|
||
-- | ||
-- PostgreSQL database dump complete | ||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
-- | ||
-- PostgreSQL database dump | ||
-- | ||
|
||
-- Dumped from database version 9.6.18 | ||
-- Dumped by pg_dump version 12.3 | ||
|
||
SET statement_timeout = 0; | ||
SET lock_timeout = 0; | ||
SET idle_in_transaction_session_timeout = 0; | ||
SET client_encoding = 'UTF8'; | ||
SET standard_conforming_strings = on; | ||
SELECT pg_catalog.set_config('search_path', '', false); | ||
SET check_function_bodies = false; | ||
SET xmloption = content; | ||
SET client_min_messages = warning; | ||
SET row_security = off; | ||
|
||
SET default_tablespace = ''; | ||
|
||
-- | ||
-- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE TABLE public.e2e_user_posts ( | ||
id uuid NOT NULL, | ||
user_id uuid NOT NULL, | ||
slug character varying(64) NOT NULL, | ||
content character varying(255) DEFAULT ''::character varying NOT NULL | ||
); | ||
|
||
|
||
ALTER TABLE public.e2e_user_posts OWNER TO postgres; | ||
|
||
-- | ||
-- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE TABLE public.e2e_users ( | ||
id uuid NOT NULL, | ||
username character varying(255), | ||
created_at timestamp without time zone NOT NULL, | ||
updated_at timestamp without time zone NOT NULL | ||
); | ||
|
||
|
||
ALTER TABLE public.e2e_users OWNER TO postgres; | ||
|
||
-- | ||
-- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE TABLE public.schema_migration ( | ||
version character varying(14) NOT NULL | ||
); | ||
|
||
|
||
ALTER TABLE public.schema_migration OWNER TO postgres; | ||
|
||
-- | ||
-- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres | ||
-- | ||
|
||
ALTER TABLE ONLY public.e2e_user_posts | ||
ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); | ||
|
||
|
||
-- | ||
-- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres | ||
-- | ||
|
||
ALTER TABLE ONLY public.e2e_users | ||
ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); | ||
|
||
|
||
-- | ||
-- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); | ||
|
||
|
||
-- | ||
-- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); | ||
|
||
|
||
-- | ||
-- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres | ||
-- | ||
|
||
CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); | ||
|
||
|
||
-- | ||
-- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres | ||
-- | ||
|
||
ALTER TABLE ONLY public.e2e_user_posts | ||
ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; | ||
|
||
|
||
-- | ||
-- PostgreSQL database dump complete | ||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.