Create a database schema

In this topic, you learn how you create a database schema with SQL client as you need a database to work with your virtual machine.

Prerequisites

Procedure

  1. Open your Postgres database.

  2. Click Connection Security > Add client IP.

  3. Add your public IP address.

    Disable Enforce SSL connection in case your SQL client does not support this.
  4. Start an SQL client. The following steps base on Adminer but other SQL clients work similarly.

  5. Open a console and type the following to start Docker and the Adminer client.:

    docker run -p 9000:8080 adminer
  6. Type in your browser:

    localhost:9000
  7. Press Enter.

  8. Click System > PostgreSQL.

    1. Enter a server name. This must be the server name specified in the Azure portal.

    2. Enter an admin username. This must be the username specified in the Azure portal.

    3. Enter a password. This must be the password you used when creating the database.

      You do not need to specify a database.
  9. Click Login.

  10. Select the target database.

  11. Run the following SQL script against that target database:

    create schema planet9
  12. Stop the Docker image.

  13. Click Connection Security > Enforce SSL connection.

Result

  • You have created a database schema with SQL client.