Skip to content

Commit b0ec5af

Browse files
committed
Added table creating script
1 parent 2acff13 commit b0ec5af

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
markdown-to-notion
22
===
33

4-
This script import markdown notes to Notion.
4+
This script import markdown notes to Notion
55

66
## Requirements
77

@@ -10,10 +10,17 @@ This script import markdown notes to Notion.
1010

1111
## How to run
1212

13-
1. Get `NOTION_TOKEN` and give access to your note where the data will be imported
13+
1. Create db and table `imported_notes` using script `db.sql`
14+
15+
```bash
16+
sudo -u postgres createdb notion-test
17+
sudo -u postgres psql -d notion-test -f db.sql
18+
```
19+
20+
2. Get `NOTION_TOKEN` and give access to your note where the data will be imported
1421
- [Create your integration in Notion](https://developers.notion.com/docs/create-a-notion-integration#getting-started)
1522

16-
2. Run the script specifying the folder with markdown notes
23+
3. Run the script specifying the folder with markdown notes
1724

1825
```bash
1926
export NOTION_TOKEN 'secret_notion_token'
@@ -25,17 +32,13 @@ export DB_PASSWORD 'notion-password'
2532
node index.js --import /path/to/notes
2633
```
2734

28-
3. Some notes may not import correctly. [Solutions](https://github.com/tryfabric/martian#working-with-notions-limits)
29-
30-
> There is no such command yet
35+
4. Some notes may not import correctly. [Solutions](https://github.com/tryfabric/martian#working-with-notions-limits)
3136

3237
```bash
3338
node index.js --show-errors
3439
```
3540

36-
4. After correcting the original notes that were imported with an error, they can be imported again
37-
38-
> There is no such command yet
41+
5. After correcting the original notes that were imported with an error, they can be imported again
3942

4043
```bash
4144
node index.js --import-with-errors /path/no/notes

db.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
create table public.imported_notes
2+
(
3+
id serial
4+
constraint imported_notes_pk
5+
primary key,
6+
title varchar not null,
7+
"filePath" varchar not null,
8+
imported boolean not null,
9+
error json,
10+
"noteId" uuid not null,
11+
skip boolean default false not null
12+
);

0 commit comments

Comments
 (0)