<commit_before>// Module included in the following assemblies:
//  * openshift_images/templates-ruby-on-rails.adoc

[id="templates-rails-creating-database-service_{context}"]
= Creating the database service

Your Rails application expects a running database service. For this service use PostgeSQL database image.

To create the database service, use the `oc new-app` command. To this command you must pass some necessary environment variables which are used inside the database container. These environment variables are required to set the username, password, and name of the database. You can change the values of these environment variables to anything you would like. The variables are as follows:

* POSTGRESQL_DATABASE
* POSTGRESQL_USER
* POSTGRESQL_PASSWORD

Setting these variables ensures:

* A database exists with the specified name.
* A user exists with the specified name.
* The user can access the specified database with the specified password.

.Procedure

. Create the database service:
+
[source,terminal]
----
$ oc new-app postgresql -e POSTGRESQL_DATABASE=db_name -e POSTGRESQL_USER=username -e POSTGRESQL_PASSWORD=password
----
+
To also set the password for the database administrator, append to the previous command with:
+<commit_msg>Fix misspelled PostgreSQL<commit_after>// Module included in the following assemblies:
//  * openshift_images/templates-ruby-on-rails.adoc

[id="templates-rails-creating-database-service_{context}"]
= Creating the database service

Your Rails application expects a running database service. For this service use PostgreSQL database image.

To create the database service, use the `oc new-app` command. To this command you must pass some necessary environment variables which are used inside the database container. These environment variables are required to set the username, password, and name of the database. You can change the values of these environment variables to anything you would like. The variables are as follows:

* POSTGRESQL_DATABASE
* POSTGRESQL_USER
* POSTGRESQL_PASSWORD

Setting these variables ensures:

* A database exists with the specified name.
* A user exists with the specified name.
* The user can access the specified database with the specified password.

.Procedure

. Create the database service:
+
[source,terminal]
----
$ oc new-app postgresql -e POSTGRESQL_DATABASE=db_name -e POSTGRESQL_USER=username -e POSTGRESQL_PASSWORD=password
----
+
To also set the password for the database administrator, append to the previous command with:
+
{'fraction_non_alphanumeric': 0.0600553141050968, 'fraction_numerical': 0.0, 'mean_word_length': 4.929742388758783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5522794', 'n_tokens_mistral': 673, 'n_tokens_neox': 638, 'n_words': 304}