--- nfo/perl/libs/Tangram/Relational/Engine.pm 2002/11/15 11:44:49 1.1 +++ nfo/perl/libs/Tangram/Relational/Engine.pm 2002/11/15 12:37:37 1.2 @@ -436,13 +436,14 @@ foreach my $class (keys %{$schema->{classes}}) { my $classdef = $classes->{$class}; - my $tabledef = $tables->{ $classdef->{table} } ||= {}; my $cols = $tabledef->{COLS} ||= {}; $cols->{ $schema->{sql}{id_col} } = $schema->{sql}{id}; $cols->{ $schema->{sql}{class_col} || 'type' } = $schema->{sql}{cid} if $self->{ROOT_TABLES}{$classdef->{table}}; + + $tables->{$class}->{SQL} = $classdef->{sql} if $classdef->{sql}; foreach my $typetag (keys %{$classdef->{members}}) { @@ -600,11 +601,12 @@ { my $def = $tables->{$table}; my $cols = $def->{COLS}; + my $sql = $def->{SQL}; my @base_cols; - my $id_col = $schema->{sql}{id_col}; my $class_col = $schema->{sql}{class_col} || 'type'; + my $table_type = $sql->{table_type} || $schema->{sql}{table_type}; push @base_cols, "$id_col $schema->{sql}{id} NOT NULL,\n PRIMARY KEY( id )" if exists $cols->{$id_col}; push @base_cols, "$class_col $schema->{sql}{cid} NOT NULL" if exists $cols->{$class_col}; @@ -614,9 +616,11 @@ $do->("CREATE TABLE $table\n(\n ", join( ",\n ", @base_cols, map { "$_ $cols->{$_}" } keys %$cols ), - "\n)" ); + "\n)", ($table_type ? " TYPE=$table_type" : '') ); } +my $table_type = $schema->{sql}{table_type}; +my $control_type = ($table_type ? " TYPE=$table_type" : ''); my $control = $schema->{control}; $do->( <get_deploy_info();