Skip to content

Commit d5d6c69

Browse files
authored
Merge pull request #20 from mongodb-developer/schema-create-project
Improved how to create the project
2 parents 7f5bd99 + 0daa01a commit d5d6c69

11 files changed

+30
-14
lines changed

docs/30-schema-in-postgresql.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import Screenshot from "@site/src/components/Screenshot";
22

33
# 📘 Schema in PostgreSQL
44

5-
The following screenshot shows an entity-relationship diagram of the relational database we wish to migrate. This is a library management app that stores information about books, where a book can have many authors, an author can write many books, and users can borrow books and leave reviews.
5+
The following screenshot shows an entity-relationship diagram of the relational database we wish to migrate. This is a library management app that stores information about books, where a book can have many authors, an author can write many books, and users can borrow books and leave reviews. You can have many copies of the same book (issue_details) and those are what users borrow and return. A library user can have many addresses.
66

77
This is the sample schema we use during our [Developer Days's Intro Lab](https://mongodb-developer.github.io/intro-lab/docs/importing-data/intro).
88

9-
<Screenshot url="https://www.mongodb.com/products/tools/relational-migrator" src="img/30-image-001.png" alt="Screenshot of the connect modal" />
9+
[![Screenshot of the PostgreSQL ERD](/img/30-image-001.png)](/img/30-image-001.png)
10+
_Click to enlarge in a new tab / window_

docs/50-create-project/50-create-new-project.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Ensure Relational Migrator is installed and running (usually at http://127.0.0.1
99
## Click on New Project
1010

1111

12-
<Screenshot url="https://www.mongodb.com/products/tools/relational-migrator" src="img/50-image-001.png" alt="Screenshot of the connect modal" />
12+
<Screenshot url="http://127.0.0.1:8278" src="img/50-image-001.png" alt="Screenshot of the connect modal" />
1313

1414
## Select one of the three options
15-
- Click **Connect to live database** if you are running the origin DB in the cloud, Docker or using your own hardware.
15+
- Click **Connect database** if you are running the origin DB in the cloud, Docker or using your own hardware.
1616
- Click **Load schema from a file** if you don't have access to a source database and just want to work with the schema (you won't have any data to import though).
1717
- Click **Use a sample schema** to play around with a test schema, without any data. This does not require connecting to a real DB. We won't use this one in this Lab.
1818

19-
<Screenshot url="https://www.mongodb.com/products/tools/relational-migrator" src="img/50-image-002.png" alt="Screenshot of the connect modal" />
19+
<Screenshot url="http://127.0.0.1:8278" src="img/50-image-002.png" alt="Screenshot of the connect modal" />

docs/50-create-project/60-connect-database.mdx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,29 @@ import Screenshot from "@site/src/components/Screenshot";
22

33
# 👐 Connect to the Database
44

5+
## Add a new connection
6+
7+
We can store the credentials of our database so in the next session we can connect quickly. In this case, we'll create a new connection selecting "Add a new connection".
8+
59
## Select PostgreSQL as Database Type
610

11+
Then we'll select PostgreSQL as our source database.
12+
713
<Screenshot url="https://www.mongodb.com/products/tools/relational-migrator" src="img/60-image-000.png" alt="Selecting PostgreSQL as Database" />
814

915
## Enter connection details
1016

1117
Enter the details for the PostgreSQL database you will be migrating from.
1218

13-
- If your instructors have configured a server for you to use, ask them for the host name, username and password. It's important to click on the `SSL` tab and active SSL.
14-
- If you followed the steps to configure PostgreSQL in a docker container, the hostname will be `localhost`, username `postgres` and password `postgres`.
15-
16-
Click `Test Connection` to ensure your details are correct.
17-
18-
Click `Connect` to proceed to the next step.
19+
- It's important to click on the `SSL` tab and activate SSL (SSL mode Prefer is fine), otherwise we won't be able to connect to cloud hosted databases.
20+
- If your instructors have configured a server for you to use, ask them for the host name, username and password.
21+
- Database name should be "library"
22+
- Click `Test Connection` to ensure your details are correct.
23+
- Click `Connect` to proceed to the next step.
24+
- You can give your connection a name and a tag to make it simpler to remember later
1925

2026
<Screenshot url="https://www.mongodb.com/products/tools/relational-migrator" src="img/60-image-001.png" alt="Screenshot of the connect modal" />
27+
28+
:::info
29+
🦸‍♂️ If you have followed the steps to configure PostgreSQL in a docker container, the hostname will be `localhost`, username `postgres` and password `postgres`.
30+
:::

docs/50-create-project/70-select-tables.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import Screenshot from "@site/src/components/Screenshot";
22

33
# 👐 Select Tables
44

5-
We want to migrate data from all of the tables, so check all of them and then click `Next`.
5+
We want to migrate data from all of the tables, so check all of them (just check the library database) and then click `Next`.
66

77
<Screenshot url="https://www.mongodb.com/products/tools/relational-migrator" src="img/70-image-001.png" alt="Screenshot of the connect modal" />
8+
9+
:::tip
10+
In a real project, you can select just a handful tables in case you're not interested in the whole database.
11+
:::

docs/50-create-project/80-define-initial-schema.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import Screenshot from "@site/src/components/Screenshot";
22

33
# 👐 Define the Initial Schema
44

5-
Relational Migrator gives you three options on how your MongoDB schema should be created. Regardless of which option you choose,
6-
you can manually modify your schema later.
5+
Relational Migrator gives you three options on how your MongoDB schema should be created. Regardless of which option you choose, you can manually modify your schema later.
76

87
Select `Start with a recommended MongoDB schema`
98

@@ -21,4 +20,6 @@ Any tables you did not check will be embedded in other collections.
2120

2221
<Screenshot url="https://www.mongodb.com/products/tools/relational-migrator" src="img/80-image-001.png" alt="Screenshot of the connect modal" />
2322

23+
Select the casing you'd like for your collections. Defaults to camelCase.
24+
2425
Click `Next`, then give your project a name.

static/img/30-image-001.png

-53.3 KB
Loading

static/img/50-image-001.png

169 KB
Loading

static/img/50-image-002.png

51 KB
Loading

static/img/60-image-000.png

6.02 KB
Loading

static/img/60-image-001.png

-180 KB
Loading

0 commit comments

Comments
 (0)