Minor DBMS fixes

Use bigint and bigserial (64bit)
Rename "primary" to "is_primary"