mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
Database collations (#489)
* SyncDatabases * Collation on Create inc WordPress * Refactored Enum * Resolve sync issue * Fix for PostgreSQL * pint * reversed enum * style adjustments * add unit tests * style * fix tests * more tests --------- Co-authored-by: Saeed Vaziry <61919774+saeedvaziry@users.noreply.github.com> Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
if ! sudo -u postgres psql -c "CREATE DATABASE \"{{ $name }}\""; then
|
||||
if ! sudo -u postgres psql -c "CREATE DATABASE \"{{ $name }}\" WITH ENCODING '{{ $charset }}'"; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
if ! sudo -u postgres psql -c "SELECT collname as collation,
|
||||
pg_encoding_to_char(collencoding) as charset,
|
||||
'' as id,
|
||||
'' as \"default\",
|
||||
'Yes' as compiled,
|
||||
'' as sortlen,
|
||||
'' as pad_attribute
|
||||
FROM pg_collation
|
||||
WHERE not pg_encoding_to_char(collencoding) = ''
|
||||
ORDER BY charset;";
|
||||
then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
@ -0,0 +1,8 @@
|
||||
if ! sudo -u postgres psql -c "SELECT
|
||||
datname AS database_name,
|
||||
pg_encoding_to_char(encoding) AS charset,
|
||||
datcollate AS collation
|
||||
FROM pg_database;";
|
||||
then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
Reference in New Issue
Block a user