@@ -441,7 +441,7 @@ function create_connection(tulipa::TulipaData, db = ":memory:")
441441 connection,
442442 " CREATE OR REPLACE TABLE profiles (
443443 profile_name VARCHAR,
444- year INT64,
444+ milestone_year INT64,
445445 scenario INT64,
446446 timestep INT64,
447447 value DOUBLE,
@@ -469,7 +469,7 @@ function create_connection(tulipa::TulipaData, db = ":memory:")
469469 # Use DataFrame for efficient bulk insertion
470470 profiles_df = DataFrame (
471471 profile_name = profile_name,
472- year = year,
472+ milestone_year = year,
473473 scenario = scenario,
474474 timestep = 1 : length (profile_value),
475475 value = profile_value,
@@ -511,7 +511,7 @@ function create_connection(tulipa::TulipaData, db = ":memory:")
511511 " CREATE OR REPLACE TABLE flows_profiles (
512512 from_asset VARCHAR,
513513 to_asset VARCHAR,
514- year INT64,
514+ milestone_year INT64,
515515 profile_name VARCHAR,
516516 profile_type VARCHAR,
517517 )" ,
@@ -523,7 +523,7 @@ function create_connection(tulipa::TulipaData, db = ":memory:")
523523 profile_name = " $from_asset_name -$to_asset_name -$profile_type -$year "
524524 profiles_df = DataFrame (
525525 profile_name = profile_name,
526- year = year,
526+ milestone_year = year,
527527 scenario = scenario,
528528 timestep = 1 : length (profile_value),
529529 value = profile_value,
@@ -543,7 +543,7 @@ function create_connection(tulipa::TulipaData, db = ":memory:")
543543 " INSERT INTO flows_profiles BY NAME (SELECT
544544 '$from_asset_name ' AS from_asset,
545545 '$to_asset_name ' AS to_asset,
546- $year AS year ,
546+ $year AS milestone_year ,
547547 '$profile_name ' AS profile_name,
548548 '$profile_type ' AS profile_type,
549549 )" ,
@@ -660,7 +660,7 @@ function create_connection(tulipa::TulipaData, db = ":memory:")
660660 end
661661
662662 # Table assets_rep_periods_partitions
663- columns = [" asset" , " year " , " rep_period" , " specification" , " partition" ]
663+ columns = [" asset" , " milestone_year " , " rep_period" , " specification" , " partition" ]
664664 need_table = any (
665665 length (tulipa. graph[a]. partitions) > 0 for a in MetaGraphsNext. labels (tulipa. graph)
666666 )
@@ -679,7 +679,7 @@ function create_connection(tulipa::TulipaData, db = ":memory:")
679679 end
680680 for ((year, rep_period), value) in partitions
681681 query = " INSERT INTO assets_rep_periods_partitions BY NAME (SELECT '$asset_name ' AS asset, "
682- query *= " $year as year , $rep_period as rep_period,"
682+ query *= " $year as milestone_year , $rep_period as rep_period,"
683683 specification = get (value, :specification , " uniform" )
684684 partition = value[:partition ] # no default for partition
685685 query *= _get_select_query_row (
@@ -698,7 +698,14 @@ function create_connection(tulipa::TulipaData, db = ":memory:")
698698 end
699699 end
700700
701- columns = [" from_asset" , " to_asset" , " year" , " rep_period" , " specification" , " partition" ]
701+ columns = [
702+ " from_asset" ,
703+ " to_asset" ,
704+ " milestone_year" ,
705+ " rep_period" ,
706+ " specification" ,
707+ " partition" ,
708+ ]
702709 need_table = any (
703710 length (tulipa. graph[e... ]. partitions) > 0 for
704711 e in MetaGraphsNext. edge_labels (tulipa. graph)
@@ -718,7 +725,7 @@ function create_connection(tulipa::TulipaData, db = ":memory:")
718725 end
719726 for ((year, rep_period), value) in partitions
720727 query = " INSERT INTO flows_rep_periods_partitions BY NAME (SELECT '$from_asset_name ' AS from_asset, '$to_asset_name ' AS to_asset,"
721- query *= " $year as year , $rep_period as rep_period, "
728+ query *= " $year as milestone_year , $rep_period as rep_period, "
722729 specification = get (value, :specification , " uniform" )
723730 partition = value[:partition ] # no default for partition
724731 query *= _get_select_query_row (
0 commit comments