@@ -11,7 +11,7 @@ import type {
1111 PropertyYaml ,
1212} from './utils/seed.types'
1313import { create_schema_hash , get_saved_schema_hash } from './utils/schema'
14- import { PLURALS , type StructureType } from './config'
14+ import { PLURALS , STRUCTURES , type StructureType } from './config'
1515
1616const db = get_client ( )
1717
@@ -115,17 +115,14 @@ function seed_config() {
115115 )
116116
117117 function insert_config ( config : ConfigYaml ) {
118- for ( const tag of config . shared_tags ) {
119- tag_insert . run ( tag , 'category' )
120- tag_insert . run ( tag , 'functor' )
121- }
122-
123- for ( const tag of config . category_tags ) {
124- tag_insert . run ( tag , 'category' )
125- }
118+ for ( const type of STRUCTURES ) {
119+ for ( const tag of config . shared_tags ) {
120+ tag_insert . run ( tag , type )
121+ }
126122
127- for ( const tag of config . functor_tags ) {
128- tag_insert . run ( tag , 'functor' )
123+ for ( const tag of config [ `${ type } _tags` ] ) {
124+ tag_insert . run ( tag , type )
125+ }
129126 }
130127
131128 for ( const { relation, conditional } of config . relations ) {
0 commit comments