Fix postgres schema usage
This commit is contained in:
9
Makefile
9
Makefile
@@ -66,7 +66,7 @@ integration-test-sqlite:
|
|||||||
|
|
||||||
.PHONY: sql
|
.PHONY: sql
|
||||||
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 settings >> app/Schema/Sql/postgres.sql
|
||||||
@ pg_dump -d kanboard --column-inserts --data-only --table links >> 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 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
|
@ 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;" | \
|
@ let password_hash=`php -r "echo password_hash('admin', PASSWORD_DEFAULT);"` ;\
|
||||||
tee -a app/Schema/Sql/postgres.sql app/Schema/Sql/mysql.sql >/dev/null
|
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` ;\
|
@ 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
|
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` ;\
|
@ 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
|
@ 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
|
-- PostgreSQL database dump complete
|
||||||
--
|
--
|
||||||
|
|
||||||
INSERT INTO users (username, password, role) VALUES ('admin', '$2y$10$GzDCeQl/GdH.pCZfz4fWdO3qmayutRCmxEIY9U9t1k9q9F89VNDCm', 'app-admin');
|
INSERT INTO public.users (username, password, role) VALUES ('admin', '$2y$10$GzDCeQl/GdH.pCZfz4fWdO3qmayutRCmxEIY9U9t1k9q9F89VNDCm', 'app-admin');
|
||||||
INSERT INTO schema_version VALUES ('111');
|
INSERT INTO public.schema_version VALUES ('111');
|
||||||
|
|||||||
Reference in New Issue
Block a user