Use auto-assigned primary key instead of random ID

In SQLite, each record has a ROWID which is automatically assigned for
each row in the table, and is unique for each row. If a table contains a
column of type INTEGER PRIMARY KEY, that column becomes an alias for
ROWID. By setting an INTEGER PRIMARY KEY for notes, each note now has
an automatically assigned ID that is unique among all notes in the
table. This means I no longer have to rely on manually assigning random
integers to each note, which is why the rand-max definition is now
removed.
Only create tables if database does not exist