Triggers - Keys

LabKey Support Forum
Triggers - Keys marcia hon  2018-01-31 07:07
Status: Closed
 
Hello,

I am investigating the trigger modules. I am able to get the sample # 1 to work.

My question is how do I make the keys start from another number instead of at 1.

I have tried the following code, but it did not work:

/* TESTING SEQUENCING */
CREATE SEQUENCE seq_test START 1000000;
    
CREATE TABLE testtriggers.Items (
    ItemId int DEFAULT nextval('seq_test') NOT NULL,
    ItemName varchar(255) NOT NULL,
    Price numeric(7,2),
    Category int,
    CONSTRAINT pk_Items PRIMARY KEY (ItemId),
    CONSTRAINT fk_Items_Categories FOREIGN KEY(Category) REFERENCES testtriggers.Categories(CategoryId)
);
 
 
marcia hon responded:  2018-02-01 07:27
Hello,

I deleted schema and module. And redid testtriggers.module setup.

However, now I get this error: org.postgresql.util.PSQLException: ERROR: relation "testtriggers.Categories" does not exist Position: 107

Additionally, at Postgres, I do not see the schema "testtriggers".


Marcia
 
marcia hon responded:  2018-02-01 12:07
Solved. The trick I used, was to do a "dos2unix" for the testtriggers.module file.