Здесь показаны различия между двумя версиями данной страницы.
| Следующая версия | Предыдущая версия | ||
|
postgres:uuid [2021/11/10 15:37] werwolf создано |
postgres:uuid [2023/01/12 12:18] (текущий) |
||
|---|---|---|---|
| Строка 18: | Строка 18: | ||
| If it is installed you should see it listed like it is below | If it is installed you should see it listed like it is below | ||
| - | {{https://miro.medium.com/max/60/1*VtQNCDrIlyo7vYBCHj04_Q.png?q=20?700x209}}{{https://miro.medium.com/max/700/1*VtQNCDrIlyo7vYBCHj04_Q.png?700x209}}{{https://miro.medium.com/max/1400/1*VtQNCDrIlyo7vYBCHj04_Q.png?700x209}}If not present, install “uuid-ossp” | + | |
| + | {{https://miro.medium.com/max/700/1*VtQNCDrIlyo7vYBCHj04_Q.png?700x209}}\\ | ||
| + | |||
| + | {{https://miro.medium.com/max/1400/1*VtQNCDrIlyo7vYBCHj04_Q.png?700x209}} \\ | ||
| + | |||
| + | If not present, install “uuid-ossp” | ||
| <code> | <code> | ||
| Строка 41: | Строка 46: | ||
| # DROP EXTENSION "uuid-ossp"; | # DROP EXTENSION "uuid-ossp"; | ||
| </code> | </code> | ||
| + | |||
| + | ===== Database setup¶ ===== | ||
| + | |||
| + | XCU stores some data in a PostgreSQL database. By default, ''application.conf'' is configured to connect to a local database named ''icx'' with the username ''icx'' and password ''icx''. You can change these parameters if you wish. We will use the default parameters in this documentation. | ||
| + | |||
| + | First, we need to install PostgresSQL extensions to use UUID functions : | ||
| + | |||
| + | <code> | ||
| + | sudo apt-get install postgresql-contrib | ||
| + | </code> | ||
| + | |||
| + | We can now create the user and the database associated : | ||
| + | |||
| + | <code> | ||
| + | sudo -u postgres psql -c "CREATE USER icx WITH PASSWORD 'icx'" | ||
| + | </code> | ||
| + | |||
| + | <code> | ||
| + | sudo -u postgres psql -c "CREATE DATABASE icx WITH OWNER icx" | ||
| + | </code> | ||
| + | |||
| + | We then have to enable UUID extension on the ''icx'' database. Connect as ''root'' on the ''icx'' database : | ||
| + | |||
| + | <code> | ||
| + | sudo -u postgres psql icx -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";' | ||
| + | </code> | ||
| + | |||
| + | <code> | ||
| + | SELECT uuid_generate_v4() | ||
| + | </code> | ||
| + | |||
| + | |||