@@ -68,36 +68,36 @@ pub fn initialize_hord_db(path: &PathBuf, ctx: &Context) -> Connection {
68
68
)" ,
69
69
[ ] ,
70
70
) {
71
- ctx. try_log ( |logger| slog:: error !( logger, "{}" , e. to_string( ) ) ) ;
72
- }
73
- if let Err ( e) = conn. execute (
74
- "CREATE TABLE IF NOT EXISTS transfers (
75
- block_height INTEGER NOT NULL PRIMARY KEY
76
- )" ,
77
- [ ] ,
78
- ) {
79
- ctx. try_log ( |logger| slog:: error !( logger, "{}" , e. to_string( ) ) ) ;
80
- }
71
+ ctx. try_log ( |logger| slog:: warn !( logger, "{}" , e. to_string( ) ) ) ;
72
+ } else {
73
+ if let Err ( e) = conn. execute (
74
+ "CREATE TABLE IF NOT EXISTS transfers (
75
+ block_height INTEGER NOT NULL PRIMARY KEY
76
+ )" ,
77
+ [ ] ,
78
+ ) {
79
+ ctx. try_log ( |logger| slog:: warn !( logger, "{}" , e. to_string( ) ) ) ;
80
+ }
81
81
82
- if let Err ( e) = conn. execute (
83
- "CREATE INDEX IF NOT EXISTS index_inscriptions_on_outpoint_to_watch ON inscriptions(outpoint_to_watch);" ,
84
- [ ] ,
85
- ) {
86
- ctx. try_log ( |logger| slog:: error!( logger, "{}" , e. to_string( ) ) ) ;
87
- }
88
- if let Err ( e) = conn. execute (
89
- "CREATE INDEX IF NOT EXISTS index_inscriptions_on_ordinal_number ON inscriptions(ordinal_number);" ,
90
- [ ] ,
91
- ) {
92
- ctx. try_log ( |logger| slog:: error!( logger, "{}" , e. to_string( ) ) ) ;
93
- }
94
- if let Err ( e) = conn. execute (
95
- "CREATE INDEX IF NOT EXISTS index_inscriptions_on_block_height ON inscriptions(block_height);" ,
96
- [ ] ,
97
- ) {
98
- ctx. try_log ( |logger| slog:: error!( logger, "{}" , e. to_string( ) ) ) ;
82
+ if let Err ( e) = conn. execute (
83
+ "CREATE INDEX IF NOT EXISTS index_inscriptions_on_outpoint_to_watch ON inscriptions(outpoint_to_watch);" ,
84
+ [ ] ,
85
+ ) {
86
+ ctx. try_log ( |logger| slog:: warn!( logger, "{}" , e. to_string( ) ) ) ;
87
+ }
88
+ if let Err ( e) = conn. execute (
89
+ "CREATE INDEX IF NOT EXISTS index_inscriptions_on_ordinal_number ON inscriptions(ordinal_number);" ,
90
+ [ ] ,
91
+ ) {
92
+ ctx. try_log ( |logger| slog:: warn!( logger, "{}" , e. to_string( ) ) ) ;
93
+ }
94
+ if let Err ( e) = conn. execute (
95
+ "CREATE INDEX IF NOT EXISTS index_inscriptions_on_block_height ON inscriptions(block_height);" ,
96
+ [ ] ,
97
+ ) {
98
+ ctx. try_log ( |logger| slog:: warn!( logger, "{}" , e. to_string( ) ) ) ;
99
+ }
99
100
}
100
-
101
101
conn
102
102
}
103
103
0 commit comments