'PostgresQL Query totally baffling me

I'm dealing with a django-silk issue trying to figure out what it won't migrate. It says all migrations complete and then when I run my code it gives me a warning that I still have 8 unapplied migrations, despite double checking with python manage.py migrate --plan. I'm pretty stumped at this point so I began setting up queries to just populate the db with the info already.

And now the query is giving me a syntax error that for the life of me I can't understand! Hoping there are some Postgres masters here who can tell me what I'm missing. Thanks!

Here's the query:

CREATE TABLE IF NOT EXISTS public.silk_request(
    id character varying(36) COLLATE pg_catalog."default" NOT NULL,
    path character varying(190) COLLATE pg_catalog."default" NOT NULL,
    query_params text COLLATE pg_catalog."default" NOT NULL,
    raw_body text COLLATE pg_catalog."default" NOT NULL,
    body text COLLATE pg_catalog."default" NOT NULL,
    method character varying(10) COLLATE pg_catalog."default" NOT NULL,
    start_time timestamp with time zone NOT NULL,
    view_name character varying(190) COLLATE pg_catalog."default",
    end_time timestamp with time zone,
    time_taken double precision,
    encoded_headers text COLLATE pg_catalog."default" NOT NULL,
    meta_time double precision,
    meta_num_queries integer,
    meta_time_spent_queries double precision,
    pyprofile text COLLATE pg_catalog."default" NOT NULL,
    num_sql_queries integer NOT NULL,
    prof_file character varying(300) COLLATE pg_catalog."default" NOT NULL,
    CONSTRAINT silk_request_pkey PRIMARY KEY (id)
) TABLESPACE pg_default;
ALTER TABLE
    IF EXISTS public.silk_request OWNER to tapappdbuser;CREATE INDEX IF NOT EXISTS silk_request_id_5a356c4f_like ON public.silk_request USING btree (
        id COLLATE pg_catalog."default" varchar_pattern_ops ASC NULLS LAST
    ) TABLESPACE pg_default;CREATE INDEX IF NOT EXISTS silk_request_path_9f3d798e ON public.silk_request USING btree (path COLLATE pg_catalog."default" ASC NULLS LAST) TABLESPACE pg_default;CREATE INDEX IF NOT EXISTS silk_request_path_9f3d798e_like ON public.silk_request USING btree (
        path COLLATE pg_catalog."default" varchar_pattern_ops ASC NULLS LAST
    ) TABLESPACE pg_default;CREATE INDEX IF NOT EXISTS silk_request_start_time_1300bc58 ON public.silk_request USING btree (start_time ASC NULLS LAST) TABLESPACE pg_default;CREATE INDEX IF NOT EXISTS silk_request_view_name_68559f7b ON public.silk_request USING btree (
        view_name COLLATE pg_catalog."default" ASC NULLS LAST
    ) TABLESPACE pg_default;CREATE INDEX IF NOT EXISTS silk_request_view_name_68559f7b_like ON public.silk_request USING btree (
        view_name COLLATE pg_catalog."default" varchar_pattern_ops ASC NULLS LAST
    ) TABLESPACE pg_default;

Thanks!

Update:

Here's the error message. Sorry should've included originally.

ERROR:  syntax error at or near "("
LINE 5: ...t" NOT NULL,
CONSTRAINT silk_request_pkey PRIMARY KEY (id))

                                                                 ^
SQL state: 42601
Character: 1015


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source