Use 'primary key' constraint instead of index
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
parent
706fbc6550
commit
2ec320acec
|
|
@ -104,9 +104,15 @@ impl<R: Reactor> Client<R> {
|
||||||
let time = LocalTime::now();
|
let time = LocalTime::now();
|
||||||
let storage = self.profile.storage;
|
let storage = self.profile.storage;
|
||||||
let signer = self.profile.signer;
|
let signer = self.profile.signer;
|
||||||
let addresses =
|
let node_dir = self.profile.home.join(NODE_DIR);
|
||||||
address::Book::open(self.profile.home.join(NODE_DIR).join(ADDRESS_DB_FILE))?;
|
let address_db = node_dir.join(ADDRESS_DB_FILE);
|
||||||
let routing = routing::Table::open(self.profile.home.join(NODE_DIR).join(ROUTING_DB_FILE))?;
|
let routing_db = node_dir.join(ROUTING_DB_FILE);
|
||||||
|
|
||||||
|
log::info!("Opening address book {}..", address_db.display());
|
||||||
|
let addresses = address::Book::open(address_db)?;
|
||||||
|
|
||||||
|
log::info!("Opening routing table {}..", routing_db.display());
|
||||||
|
let routing = routing::Table::open(routing_db)?;
|
||||||
|
|
||||||
log::info!("Initializing client ({:?})..", network);
|
log::info!("Initializing client ({:?})..", network);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
-- Routing table SQL schema.
|
-- Routing table SQL schema.
|
||||||
--
|
--
|
||||||
create table if not exists "routing" (
|
create table if not exists "routing" (
|
||||||
"id" integer primary key,
|
|
||||||
-- Resource being seeded.
|
-- Resource being seeded.
|
||||||
"resource" text not null,
|
"resource" text not null,
|
||||||
-- Node ID.
|
-- Node ID.
|
||||||
|
|
@ -10,6 +9,5 @@ create table if not exists "routing" (
|
||||||
-- UNIX time at which this entry was added or refreshed.
|
-- UNIX time at which this entry was added or refreshed.
|
||||||
"time" integer not null,
|
"time" integer not null,
|
||||||
|
|
||||||
unique("resource", "node")
|
primary key ("resource", "node")
|
||||||
);
|
);
|
||||||
create index "routing_index" on routing ("resource", "node");
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue