max wrote:
can you show the schema you are trying to reverse engineer ?
It would be very nice to see on which table it fails.
Here is database:
Code:
CREATE TABLE accounts_group (
id SERIAL PRIMARY KEY,
group_name TEXT ,
gid INTEGER
);
CREATE TABLE vo (
id SERIAL PRIMARY KEY,
dn TEXT NOT NULL UNIQUE,
auth_flag SMALLINT NOT NULL DEFAULT 0,
vo_server_addr TEXT ,
vo_server_dn TEXT ,
accounts_group_id INTEGER REFERENCES accounts_group (id),
parent_vo_id INTEGER REFERENCES vo (id),
auth_until TIMESTAMP DEFAULT 'infinity'
);
CREATE TABLE globus_user (
id SERIAL PRIMARY KEY,
dn TEXT NOT NULL UNIQUE,
vo_id INTEGER REFERENCES vo (id),
auth_flag SMALLINT NOT NULL DEFAULT 0,
role_in_vo VARCHAR(20) ,
hit_ratio SMALLINT,
auth_until TIMESTAMP DEFAULT 'infinity'
);
CREATE TABLE account (
id SERIAL PRIMARY KEY,
name TEXT UNIQUE NOT NULL,
accounts_group_id INTEGER REFERENCES accounts_group (id),
globus_user_id INTEGER REFERENCES globus_user (id),
usage_counter INTEGER
);
CREATE TABLE session (
id SERIAL PRIMARY KEY,
globus_user_id INTEGER NOT NULL REFERENCES globus_user (id),
start_time TIMESTAMP DEFAULT 'now',
end_time TIMESTAMP ,
account_id INTEGER REFERENCES account (id)
);
CREATE TABLE resource_type (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL UNIQUE,
unit TEXT ,
price_per_unit NUMERIC(7,2),
description TEXT
);
CREATE TABLE accounting_data (
id SERIAL PRIMARY KEY,
session_id INTEGER NOT NULL REFERENCES session (id),
resource_type_id INTEGER NOT NULL REFERENCES resource_type (id),
volume FLOAT ,
cost_per_unit NUMERIC(7,2)
);
CREATE TABLE accounting_sum (
id SERIAL PRIMARY KEY,
globus_user_id INTEGER NOT NULL REFERENCES globus_user (id),
vo_id INTEGER NOT NULL REFERENCES vo (id),
start_time TIMESTAMP,
end_time TIMESTAMP,
resource_type_id INTEGER NOT NULL REFERENCES resource_type (id),
cluster_dn TEXT NOT NULL REFERENCES globus_user (dn),
volume FLOAT,
cost NUMERIC(8,2)
);