Ignore:
Timestamp:
05/26/20 02:14:04 (4 years ago)
Author:
nanardon
Message:

Add basic template features

Location:
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm

    r2296 r2352  
    1818our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0]; 
    1919 
    20 sub SCHEMA_VERSION { 36 }; 
     20sub SCHEMA_VERSION { 37 }; 
    2121 
    2222=head1 NAME 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm

    r2328 r2352  
    262262                ) ]; 
    263263            }, 
     264        }, 
     265        template => { 
     266            reference => 'templates', 
     267            can_values => sub { 
     268                $base->search_objects('templates', 'objectType=' . $class->type, 'exported=1') 
     269            }, 
     270            ro => sub { ref $_[0] ? 1 : 0 }, 
     271            set => sub {}, 
    264272        }, 
    265273    ); 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/upgrade.pm

    r2296 r2352  
    13181318            ], 
    13191319        }, 
     1320        { 
     1321            ver => 37, 
     1322            sql => [ 
     1323                qq{ 
     1324                CREATE TABLE public."templates" 
     1325                ( 
     1326                  objectType text not NULL, 
     1327                  data text[], 
     1328                  CONSTRAINT template_pkey PRIMARY KEY (name) 
     1329                ) 
     1330                INHERITS (public.objects) 
     1331                WITH ( 
     1332                  OIDS=FALSE 
     1333                ); 
     1334 
     1335                CREATE INDEX templates_rev_idx 
     1336                  ON public."templates" 
     1337                  USING btree 
     1338                  (rev); 
     1339 
     1340                CREATE INDEX templates_exported_idx 
     1341                  ON public."templates" 
     1342                  USING btree 
     1343                  (exported); 
     1344 
     1345                CREATE TRIGGER templates_rev_tg 
     1346                  BEFORE UPDATE OR DELETE 
     1347                  ON public."templates" 
     1348                  FOR EACH ROW 
     1349                  EXECUTE PROCEDURE public.rev_tg_f(); 
     1350                } 
     1351            ], 
     1352        }, 
    13201353    ); 
     1354 
    13211355 
    13221356    my $dbi = $self->{_db}; 
Note: See TracChangeset for help on using the changeset viewer.