Skip to content

Commit 0615d32

Browse files
committed
remove positions
1 parent 622f58c commit 0615d32

1 file changed

Lines changed: 11 additions & 17 deletions

File tree

databases/catdat/scripts/seed.yaml.ts

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ function seed() {
4444
seed_related_and_dual_categories(category)
4545
}
4646

47-
// TODO: seed properties
4847
// TODO: seed implications
4948
// TODO: seed category property assignments
5049
// TODO: seed category property comments
@@ -108,8 +107,8 @@ function seed_config() {
108107
config_file_content,
109108
) as ConfigYaml
110109

111-
for (let i = 0; i < tags.length; i++) {
112-
db.prepare(`INSERT INTO tags (tag, position) VALUES (?, ?)`).run([tags[i], i + 1])
110+
for (const tag of tags) {
111+
db.prepare(`INSERT INTO tags (tag) VALUES (?)`).run(tag)
113112
}
114113

115114
for (const { relation, negation, conditional } of relations) {
@@ -119,29 +118,24 @@ function seed_config() {
119118
}
120119

121120
const special_objects_query_value = Array(special_object_types.length)
122-
.fill(`(?, ?, ?)`)
121+
.fill(`(?, ?)`)
123122
.join(', ')
124-
const special_objects_query = `INSERT INTO special_object_types (type, dual, position) VALUES ${special_objects_query_value}`
123+
const special_objects_query = `INSERT INTO special_object_types (type, dual) VALUES ${special_objects_query_value}`
125124
const special_objects_values = []
126-
for (let i = 0; i < special_object_types.length; i++) {
127-
special_objects_values.push(
128-
special_object_types[i].type,
129-
special_object_types[i].dual,
130-
i + 1,
131-
)
125+
for (const special_object_type of special_object_types) {
126+
special_objects_values.push(special_object_type.type, special_object_type.dual)
132127
}
133128
db.prepare(special_objects_query).run(special_objects_values)
134129

135130
const special_morphisms_query_value = Array(special_morphism_types.length)
136-
.fill(`(?, ?, ?)`)
131+
.fill(`(?, ?)`)
137132
.join(', ')
138-
const special_morphisms_query = `INSERT INTO special_morphism_types (type, dual, position) VALUES ${special_morphisms_query_value}`
133+
const special_morphisms_query = `INSERT INTO special_morphism_types (type, dual) VALUES ${special_morphisms_query_value}`
139134
const special_morphisms_values = []
140-
for (let i = 0; i < special_morphism_types.length; i++) {
135+
for (const special_morphism_type of special_morphism_types) {
141136
special_morphisms_values.push(
142-
special_morphism_types[i].type,
143-
special_morphism_types[i].dual,
144-
i + 1,
137+
special_morphism_type.type,
138+
special_morphism_type.dual,
145139
)
146140
}
147141
db.prepare(special_morphisms_query).run(special_morphisms_values)

0 commit comments

Comments
 (0)