This commit is contained in:
dima
2024-12-08 22:11:48 +03:00
parent 66471a8a89
commit 08cc9fc069
16 changed files with 166 additions and 112 deletions

View File

@ -4,14 +4,15 @@
owner: '{{ postgres_user }}'
encoding: UTF8
state: present
tags:
- database
- name: Create contacts table in PostgreSQL
- name: Create contacts table
community.postgresql.postgresql_query:
db: '{{ postgres_db }}'
query: 'CREATE TABLE IF NOT EXISTS contacts (id SERIAL PRIMARY KEY, name VARCHAR(100), phone_number VARCHAR(15));'
query: |
CREATE TABLE IF NOT EXISTS contacts (
id SERIAL PRIMARY KEY,
name VARCHAR(100),
phone_number VARCHAR(15) UNIQUE
);
login_user: '{{ postgres_user }}'
login_password: '{{ postgres_password }}'
tags:
- database