@@ -62,15 +62,15 @@ type EntryV2 struct {
62
62
Status string `db:"status"`
63
63
}
64
64
65
- func insertSpecV2 (dbFilePath , newSpec string ) (* EntryV2 , error ) {
65
+ func insertSpecV2 (dbFilePath , newSpec , state string ) (* EntryV2 , error ) {
66
66
67
67
db , err := sql .Open ("sqlite3" , dbFilePath )
68
68
if err != nil {
69
69
return nil , err
70
70
}
71
71
defer db .Close ()
72
72
73
- q := fmt .Sprintf ("INSERT INTO openapi_schemas(schema_version,schema_format,schema_content,status) VALUES ('1', 'yaml', '%s', 'new ')" , newSpec )
73
+ q := fmt .Sprintf ("INSERT INTO openapi_schemas(schema_version,schema_format,schema_content,status) VALUES ('1', 'yaml', '%s', '%s ')" , newSpec , state )
74
74
_ , err = db .Exec (q )
75
75
if err != nil {
76
76
return nil , err
@@ -141,7 +141,7 @@ func TestLoadBasicV2(t *testing.T) {
141
141
var lock sync.RWMutex
142
142
143
143
// create DB entry with spec and status = 'new'
144
- entry , err := insertSpecV2 (currentDBPath , testYamlSpecification )
144
+ entry , err := insertSpecV2 (currentDBPath , testYamlSpecification , "new" )
145
145
if err != nil {
146
146
t .Fatal (err )
147
147
}
@@ -250,7 +250,7 @@ func TestUpdaterBasicV2(t *testing.T) {
250
250
}
251
251
252
252
// create DB entry with spec and status = 'new'
253
- entry , err := insertSpecV2 (currentDBPath , testYamlSpecification )
253
+ entry , err := insertSpecV2 (currentDBPath , testYamlSpecification , "new" )
254
254
if err != nil {
255
255
t .Fatal (err )
256
256
}
@@ -1096,7 +1096,7 @@ func TestUpdaterFromV1DBToV2(t *testing.T) {
1096
1096
1097
1097
// prepare spec with status = 'new'
1098
1098
// create DB entry with spec and status = 'new'
1099
- entry , err := insertSpecV2 (currentDBPath , testYamlSpecification )
1099
+ entry , err := insertSpecV2 (currentDBPath , testYamlSpecification , "new" )
1100
1100
if err != nil {
1101
1101
t .Fatal (err )
1102
1102
}
0 commit comments