Fix postgres schema usage
This commit is contained in:
parent
6d2b2f4a79
commit
42694ac2af
9
Makefile
9
Makefile
|
|
@ -66,7 +66,7 @@ integration-test-sqlite:
|
|||
|
||||
.PHONY: sql
|
||||
sql:
|
||||
@ pg_dump -x -O --schema-only --no-owner --no-privileges --quote-all-identifiers -n public --file app/Schema/Sql/postgres.sql kanboard
|
||||
@ pg_dump --schema-only --no-owner --no-privileges --quote-all-identifiers -n public --file app/Schema/Sql/postgres.sql kanboard
|
||||
@ pg_dump -d kanboard --column-inserts --data-only --table settings >> app/Schema/Sql/postgres.sql
|
||||
@ pg_dump -d kanboard --column-inserts --data-only --table links >> app/Schema/Sql/postgres.sql
|
||||
|
||||
|
|
@ -74,14 +74,15 @@ sql:
|
|||
@ mysqldump -uroot --quote-names --no-create-info --skip-comments --no-set-names kanboard settings >> app/Schema/Sql/mysql.sql
|
||||
@ mysqldump -uroot --quote-names --no-create-info --skip-comments --no-set-names kanboard links >> app/Schema/Sql/mysql.sql
|
||||
|
||||
@ php -r "echo 'INSERT INTO users (username, password, role) VALUES (\'admin\', \''.password_hash('admin', PASSWORD_DEFAULT).'\', \'app-admin\');'.PHP_EOL;" | \
|
||||
tee -a app/Schema/Sql/postgres.sql app/Schema/Sql/mysql.sql >/dev/null
|
||||
@ let password_hash=`php -r "echo password_hash('admin', PASSWORD_DEFAULT);"` ;\
|
||||
echo "INSERT INTO users (username, password, role) VALUES ('admin', '$$password_hash', 'app-admin');" >> app/Schema/Sql/mysql.sql ;\
|
||||
echo "INSERT INTO public.users (username, password, role) VALUES ('admin', '$$password_hash', 'app-admin');" >> app/Schema/Sql/postgres.sql
|
||||
|
||||
@ let mysql_version=`echo 'select version from schema_version;' | mysql -N -uroot kanboard` ;\
|
||||
echo "INSERT INTO schema_version VALUES ('$$mysql_version');" >> app/Schema/Sql/mysql.sql
|
||||
|
||||
@ let pg_version=`psql -U postgres -A -c 'copy(select version from schema_version) to stdout;' kanboard` ;\
|
||||
echo "INSERT INTO schema_version VALUES ('$$pg_version');" >> app/Schema/Sql/postgres.sql
|
||||
echo "INSERT INTO public.schema_version VALUES ('$$pg_version');" >> app/Schema/Sql/postgres.sql
|
||||
|
||||
@ grep -v "SET idle_in_transaction_session_timeout = 0;" app/Schema/Sql/postgres.sql > temp && mv temp app/Schema/Sql/postgres.sql
|
||||
|
||||
|
|
|
|||
|
|
@ -2747,5 +2747,5 @@ SELECT pg_catalog.setval('public.links_id_seq', 11, true);
|
|||
-- PostgreSQL database dump complete
|
||||
--
|
||||
|
||||
INSERT INTO users (username, password, role) VALUES ('admin', '$2y$10$GzDCeQl/GdH.pCZfz4fWdO3qmayutRCmxEIY9U9t1k9q9F89VNDCm', 'app-admin');
|
||||
INSERT INTO schema_version VALUES ('111');
|
||||
INSERT INTO public.users (username, password, role) VALUES ('admin', '$2y$10$GzDCeQl/GdH.pCZfz4fWdO3qmayutRCmxEIY9U9t1k9q9F89VNDCm', 'app-admin');
|
||||
INSERT INTO public.schema_version VALUES ('111');
|
||||
|
|
|
|||
Loading…
Reference in New Issue