#!/usr/bin/env python3
|
|
|
|
import os
|
|
import sqlite3
|
|
|
|
os.chdir(os.path.join(os.getenv('HOME'), 'notes'))
|
|
|
|
conn = sqlite3.connect('metadata.db')
|
|
c = conn.cursor()
|
|
|
|
c.execute(
|
|
'''CREATE TABLE links (
|
|
page text,
|
|
target text,
|
|
UNIQUE(page, target)
|
|
);
|
|
'''
|
|
)
|
|
|
|
c.execute(
|
|
'''CREATE TABLE pages (
|
|
page text,
|
|
title text,
|
|
datetime text,
|
|
UNIQUE(page)
|
|
);
|
|
'''
|
|
)
|
|
|
|
conn.commit()
|
|
conn.close()
|