 drop table if exists t_privilege;
 drop table if exists t_implemented_action;
 drop table if exists t_acl;
-drop table if exists t_status;
 drop table if exists t_action;
+
 
 create table t_action (
     c_title           text      NOT NULL PRIMARY KEY CHECK( length(c_title) >= 3 AND length(c_title) < 100 ),

    CONSTRAINT t_users_pkey         PRIMARY KEY (c_uid)
) INHERITS (t_acl);


CREATE TABLE t_files (
    c_name      TEXT    NOT NULL CHECK(length(c_name) < 4096 ),

COMMENT ON COLUMN t_action.c_title          IS 'column contains name of action';
COMMENT ON COLUMN t_action.c_apply_object   IS 'column specifies whether an action applies to objects or tables. Certain actions, like “create,” apply only to tables. I find the system is easier to manage if I choose my actions so they can only apply to one or the other, not both.';

create table t_acl (
    c_uid             serial not null primary key,
    c_owner           int not null default 1,
    c_group           int not null default 2, -- 1 is a root usergroup, 2 is 'users' set as default
    c_unixperms       int not null default unix_to_numeric('764'),
    c_status          int not null 0
);

COMMENT ON COLUMN t_acl.c_uid       IS 'unique uid for all objects in database';
