mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-10 00:07:00 +02:00
The default values for MySQL WITH clause options wasn't really tested and broke on simple cases, the new set of defaults is known to work in many cases (most?). Other combinations of options will need some review work, and we might need to consider preventing some of them, that's for another patch tho.
25 lines
788 B
Fish
25 lines
788 B
Fish
load database
|
|
from mysql://root@localhost/sakila
|
|
into postgresql:///sakila
|
|
|
|
-- WITH include drop, create tables, no truncate,
|
|
-- create indexes, reset sequences, foreign keys
|
|
|
|
SET maintenance_work_mem to '128MB', work_mem to '12MB', search_path to 'sakila'
|
|
|
|
CAST type datetime to timestamptz drop default drop not null using zero-dates-to-null,
|
|
type date drop not null drop default using zero-dates-to-null
|
|
|
|
-- type tinyint to boolean using tinyint-to-boolean,
|
|
-- type year to integer drop typemod -- now a default
|
|
|
|
-- MATERIALIZE VIEWS film_list, staff_list
|
|
MATERIALIZE ALL VIEWS
|
|
|
|
-- INCLUDING ONLY TABLE NAMES MATCHING ~/film/, 'actor'
|
|
-- EXCLUDING TABLE NAMES MATCHING ~<ory>
|
|
|
|
BEFORE LOAD DO
|
|
$$ create schema if not exists sakila; $$;
|
|
|