<%args> $schema $table $column_name $type $extended_type => undef $sequenced => 0 $nullable => 0 $default => undef $length => undef $precision => undef $primary_key => 0 @attributes => () $comment => '' $after => undef <%init> use Alzabo::GUI::Mason; my ($s, $t); eval { $s = Alzabo::Create::Schema->load_from_file( name => $schema ); $t = $s->table($table); $length = undef if $length eq ''; $precision = undef if $precision eq ''; $default = Alzabo::GUI::Mason::default_from_web( $default ); my %p = ( name => $column_name, nullable => $nullable, type => $extended_type || $type, sequenced => $sequenced, default => $default, length => $length, precision => $precision, attributes => [ grep {$_} @attributes ], comment => $comment, ); $p{after} = $t->column($after) if defined $after; $t->make_column(%p); if ($primary_key) { my $c = $t->column($column_name); $t->add_primary_key($c); } $s->save_to_file; }; my $e = $@; $m->comp( 'handle_rules_exception', e => $e, comp => 'view_table', %ARGS ); $m->comp( 'exception', $e ) if $e; $m->redirect( uri( path => 'view_table' . Alzabo::GUI::Mason::Config::mason_extension(), query => { schema => $s->name, table => $t->name }, ), ); <%flags> inherit => 'syshandler'