--
--


SELECT pg_catalog.set_config('search_path', '', false);

--
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--

-- *not* creating schema, since initdb creates it


ALTER SCHEMA public OWNER TO postgres;

--
-- Name: postgis; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;


--
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION postgis IS 'PostGIS geometry and geography spatial types and functions';




--
-- Name: api_blackedlist; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.api_blackedlist (
    id integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    phone_number character varying(15) NOT NULL,
    count integer NOT NULL
);


ALTER TABLE public.api_blackedlist OWNER TO traderun;

--
-- Name: api_blackedlist_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.api_blackedlist_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.api_blackedlist_id_seq OWNER TO traderun;

--
-- Name: api_blackedlist_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.api_blackedlist_id_seq OWNED BY public.api_blackedlist.id;


--
-- Name: api_user; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.api_user (
    id integer NOT NULL,
    password character varying(128) NOT NULL,
    last_login timestamp with time zone,
    is_superuser boolean NOT NULL,
    first_name character varying(30) NOT NULL,
    last_name character varying(150) NOT NULL,
    is_staff boolean NOT NULL,
    date_joined timestamp with time zone NOT NULL,
    email character varying(254) NOT NULL,
    is_active boolean NOT NULL,
    username character varying(150) NOT NULL,
    full_name character varying(255) NOT NULL,
    company_name character varying(255) NOT NULL,
    phone_number character varying(30) NOT NULL,
    sent_code integer,
    abn character varying(200),
    address character varying(255) NOT NULL,
    lgt double precision,
    ltd double precision,
    point public.geometry(Point,4326),
    customer_id character varying(155) NOT NULL,
    verified_supplier boolean NOT NULL,
    stripe_connect_id character varying(120),
    "group" character varying(100)
);


ALTER TABLE public.api_user OWNER TO traderun;

--
-- Name: api_user_groups; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.api_user_groups (
    id integer NOT NULL,
    user_id integer NOT NULL,
    group_id integer NOT NULL
);


ALTER TABLE public.api_user_groups OWNER TO traderun;

--
-- Name: api_user_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.api_user_groups_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.api_user_groups_id_seq OWNER TO traderun;

--
-- Name: api_user_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.api_user_groups_id_seq OWNED BY public.api_user_groups.id;


--
-- Name: api_user_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.api_user_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.api_user_id_seq OWNER TO traderun;

--
-- Name: api_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.api_user_id_seq OWNED BY public.api_user.id;


--
-- Name: api_user_user_permissions; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.api_user_user_permissions (
    id integer NOT NULL,
    user_id integer NOT NULL,
    permission_id integer NOT NULL
);


ALTER TABLE public.api_user_user_permissions OWNER TO traderun;

--
-- Name: api_user_user_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.api_user_user_permissions_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.api_user_user_permissions_id_seq OWNER TO traderun;

--
-- Name: api_user_user_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.api_user_user_permissions_id_seq OWNED BY public.api_user_user_permissions.id;


--
-- Name: auth_group; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.auth_group (
    id integer NOT NULL,
    name character varying(150) NOT NULL
);


ALTER TABLE public.auth_group OWNER TO traderun;

--
-- Name: auth_group_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.auth_group_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.auth_group_id_seq OWNER TO traderun;

--
-- Name: auth_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.auth_group_id_seq OWNED BY public.auth_group.id;


--
-- Name: auth_group_permissions; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.auth_group_permissions (
    id integer NOT NULL,
    group_id integer NOT NULL,
    permission_id integer NOT NULL
);


ALTER TABLE public.auth_group_permissions OWNER TO traderun;

--
-- Name: auth_group_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.auth_group_permissions_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.auth_group_permissions_id_seq OWNER TO traderun;

--
-- Name: auth_group_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.auth_group_permissions_id_seq OWNED BY public.auth_group_permissions.id;


--
-- Name: auth_permission; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.auth_permission (
    id integer NOT NULL,
    name character varying(255) NOT NULL,
    content_type_id integer NOT NULL,
    codename character varying(100) NOT NULL
);


ALTER TABLE public.auth_permission OWNER TO traderun;

--
-- Name: auth_permission_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.auth_permission_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.auth_permission_id_seq OWNER TO traderun;

--
-- Name: auth_permission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.auth_permission_id_seq OWNED BY public.auth_permission.id;


--
-- Name: django_admin_log; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.django_admin_log (
    id integer NOT NULL,
    action_time timestamp with time zone NOT NULL,
    object_id text,
    object_repr character varying(200) NOT NULL,
    action_flag smallint NOT NULL,
    change_message text NOT NULL,
    content_type_id integer,
    user_id integer NOT NULL,
    CONSTRAINT django_admin_log_action_flag_check CHECK ((action_flag >= 0))
);


ALTER TABLE public.django_admin_log OWNER TO traderun;

--
-- Name: django_admin_log_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.django_admin_log_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.django_admin_log_id_seq OWNER TO traderun;

--
-- Name: django_admin_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.django_admin_log_id_seq OWNED BY public.django_admin_log.id;


--
-- Name: django_content_type; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.django_content_type (
    id integer NOT NULL,
    app_label character varying(100) NOT NULL,
    model character varying(100) NOT NULL
);


ALTER TABLE public.django_content_type OWNER TO traderun;

--
-- Name: django_content_type_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.django_content_type_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.django_content_type_id_seq OWNER TO traderun;

--
-- Name: django_content_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.django_content_type_id_seq OWNED BY public.django_content_type.id;


--
-- Name: django_dramatiq_task; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.django_dramatiq_task (
    id uuid NOT NULL,
    status character varying(8) NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    message_data bytea NOT NULL,
    actor_name character varying(300),
    queue_name character varying(100)
);


ALTER TABLE public.django_dramatiq_task OWNER TO traderun;

--
-- Name: django_migrations; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.django_migrations (
    id integer NOT NULL,
    app character varying(255) NOT NULL,
    name character varying(255) NOT NULL,
    applied timestamp with time zone NOT NULL
);


ALTER TABLE public.django_migrations OWNER TO traderun;

--
-- Name: django_migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.django_migrations_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.django_migrations_id_seq OWNER TO traderun;

--
-- Name: django_migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.django_migrations_id_seq OWNED BY public.django_migrations.id;


--
-- Name: django_session; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.django_session (
    session_key character varying(40) NOT NULL,
    session_data text NOT NULL,
    expire_date timestamp with time zone NOT NULL
);


ALTER TABLE public.django_session OWNER TO traderun;

--
-- Name: django_site; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.django_site (
    id integer NOT NULL,
    domain character varying(100) NOT NULL,
    name character varying(50) NOT NULL
);


ALTER TABLE public.django_site OWNER TO traderun;

--
-- Name: django_site_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.django_site_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.django_site_id_seq OWNER TO traderun;

--
-- Name: django_site_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.django_site_id_seq OWNED BY public.django_site.id;


--
-- Name: orders_deliveryoptions; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.orders_deliveryoptions (
    id integer NOT NULL,
    title character varying(255) NOT NULL,
    sherpa_id smallint NOT NULL,
    CONSTRAINT orders_deliveryoptions_sherpa_id_check CHECK ((sherpa_id >= 0))
);


ALTER TABLE public.orders_deliveryoptions OWNER TO traderun;

--
-- Name: orders_deliveryoptions_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.orders_deliveryoptions_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.orders_deliveryoptions_id_seq OWNER TO traderun;

--
-- Name: orders_deliveryoptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.orders_deliveryoptions_id_seq OWNED BY public.orders_deliveryoptions.id;


--
-- Name: orders_order; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.orders_order (
    id integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    total_price double precision NOT NULL,
    service_fee double precision NOT NULL,
    delivery_fee double precision NOT NULL,
    client_id integer,
    store_id integer,
    supplier_id integer,
    status character varying(120) NOT NULL,
    track_order_id integer,
    charge_id character varying(120),
    delivery_address text,
    sherpa_id character varying(255),
    finally_total double precision NOT NULL,
    delivery_status character varying(155) NOT NULL,
    delivery_options_id integer,
    ready_at timestamp with time zone,
    receipt_url character varying(200),
    latitude double precision,
    longitude double precision
);


ALTER TABLE public.orders_order OWNER TO traderun;

--
-- Name: orders_order_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.orders_order_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.orders_order_id_seq OWNER TO traderun;

--
-- Name: orders_order_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.orders_order_id_seq OWNED BY public.orders_order.id;


--
-- Name: orders_orderitem; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.orders_orderitem (
    id integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    qty integer NOT NULL,
    item_total_price numeric(9,2) NOT NULL,
    order_id integer,
    product_id integer,
    availability boolean NOT NULL,
    variant_id integer,
    CONSTRAINT orders_orderitem_qty_check CHECK ((qty >= 0))
);


ALTER TABLE public.orders_orderitem OWNER TO traderun;

--
-- Name: orders_orderitem_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.orders_orderitem_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.orders_orderitem_id_seq OWNER TO traderun;

--
-- Name: orders_orderitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.orders_orderitem_id_seq OWNED BY public.orders_orderitem.id;


--
-- Name: orders_tracks; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.orders_tracks (
    id integer NOT NULL,
    title character varying(50) NOT NULL,
    sherpa_id smallint NOT NULL,
    CONSTRAINT orders_tracks_sherpa_id_check CHECK ((sherpa_id >= 0))
);


ALTER TABLE public.orders_tracks OWNER TO traderun;

--
-- Name: orders_tracks_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.orders_tracks_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.orders_tracks_id_seq OWNER TO traderun;

--
-- Name: orders_tracks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.orders_tracks_id_seq OWNED BY public.orders_tracks.id;


--
-- Name: shop_category; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.shop_category (
    id integer NOT NULL,
    title character varying(50) NOT NULL,
    image character varying(100) NOT NULL,
    lft integer NOT NULL,
    rght integer NOT NULL,
    tree_id integer NOT NULL,
    mptt_level integer NOT NULL,
    parent_id integer,
    CONSTRAINT shop_category_lft_check CHECK ((lft >= 0)),
    CONSTRAINT shop_category_mptt_level_check CHECK ((mptt_level >= 0)),
    CONSTRAINT shop_category_rght_check CHECK ((rght >= 0)),
    CONSTRAINT shop_category_tree_id_check CHECK ((tree_id >= 0))
);


ALTER TABLE public.shop_category OWNER TO traderun;

--
-- Name: shop_category_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.shop_category_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.shop_category_id_seq OWNER TO traderun;

--
-- Name: shop_category_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.shop_category_id_seq OWNED BY public.shop_category.id;


--
-- Name: shop_category_tags; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.shop_category_tags (
    id integer NOT NULL,
    category_id integer NOT NULL,
    tags_id integer NOT NULL
);


ALTER TABLE public.shop_category_tags OWNER TO traderun;

--
-- Name: shop_category_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.shop_category_tags_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.shop_category_tags_id_seq OWNER TO traderun;

--
-- Name: shop_category_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.shop_category_tags_id_seq OWNED BY public.shop_category_tags.id;


--
-- Name: shop_product; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.shop_product (
    id integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    title character varying(255) NOT NULL,
    barcode character varying(255) NOT NULL,
    description text NOT NULL,
    image character varying(100) NOT NULL,
    category_id integer,
    weight double precision NOT NULL
);


ALTER TABLE public.shop_product OWNER TO traderun;

--
-- Name: shop_product_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.shop_product_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.shop_product_id_seq OWNER TO traderun;

--
-- Name: shop_product_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.shop_product_id_seq OWNED BY public.shop_product.id;


--
-- Name: shop_productvariant; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.shop_productvariant (
    id integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    price numeric(9,2) NOT NULL,
    product_id integer NOT NULL,
    supplier_id integer NOT NULL,
    service_fee numeric(9,2) NOT NULL,
    total_price numeric(9,2) NOT NULL
);


ALTER TABLE public.shop_productvariant OWNER TO traderun;

--
-- Name: shop_productvariant_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.shop_productvariant_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.shop_productvariant_id_seq OWNER TO traderun;

--
-- Name: shop_productvariant_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.shop_productvariant_id_seq OWNED BY public.shop_productvariant.id;


--
-- Name: shop_servicefee; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.shop_servicefee (
    id integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    percent double precision NOT NULL,
    from_price double precision NOT NULL,
    to_price double precision NOT NULL
);


ALTER TABLE public.shop_servicefee OWNER TO traderun;

--
-- Name: shop_servicefee_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.shop_servicefee_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.shop_servicefee_id_seq OWNER TO traderun;

--
-- Name: shop_servicefee_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.shop_servicefee_id_seq OWNED BY public.shop_servicefee.id;


--
-- Name: shop_store; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.shop_store (
    id integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    title character varying(255) NOT NULL,
    address text NOT NULL,
    longitude double precision,
    latitude double precision,
    point public.geometry(Point,4326),
    supplier_id integer
);


ALTER TABLE public.shop_store OWNER TO traderun;

--
-- Name: shop_store_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.shop_store_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.shop_store_id_seq OWNER TO traderun;

--
-- Name: shop_store_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.shop_store_id_seq OWNED BY public.shop_store.id;


--
-- Name: shop_storeworkday; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.shop_storeworkday (
    id integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    work_from character varying(50) NOT NULL,
    work_to character varying(50) NOT NULL,
    store_id integer NOT NULL,
    workday_id integer NOT NULL
);


ALTER TABLE public.shop_storeworkday OWNER TO traderun;

--
-- Name: shop_storeworkday_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.shop_storeworkday_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.shop_storeworkday_id_seq OWNER TO traderun;

--
-- Name: shop_storeworkday_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.shop_storeworkday_id_seq OWNED BY public.shop_storeworkday.id;


--
-- Name: shop_tags; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.shop_tags (
    id integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    title character varying(255) NOT NULL
);


ALTER TABLE public.shop_tags OWNER TO traderun;

--
-- Name: shop_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.shop_tags_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.shop_tags_id_seq OWNER TO traderun;

--
-- Name: shop_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.shop_tags_id_seq OWNED BY public.shop_tags.id;


--
-- Name: shop_workday; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.shop_workday (
    id integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    title character varying(50) NOT NULL
);


ALTER TABLE public.shop_workday OWNER TO traderun;

--
-- Name: shop_workday_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.shop_workday_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.shop_workday_id_seq OWNER TO traderun;

--
-- Name: shop_workday_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.shop_workday_id_seq OWNED BY public.shop_workday.id;


--
-- Name: token_blacklist_blacklistedtoken; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.token_blacklist_blacklistedtoken (
    id integer NOT NULL,
    blacklisted_at timestamp with time zone NOT NULL,
    token_id integer NOT NULL
);


ALTER TABLE public.token_blacklist_blacklistedtoken OWNER TO traderun;

--
-- Name: token_blacklist_blacklistedtoken_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.token_blacklist_blacklistedtoken_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.token_blacklist_blacklistedtoken_id_seq OWNER TO traderun;

--
-- Name: token_blacklist_blacklistedtoken_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.token_blacklist_blacklistedtoken_id_seq OWNED BY public.token_blacklist_blacklistedtoken.id;


--
-- Name: token_blacklist_outstandingtoken; Type: TABLE; Schema: public; Owner: traderun
--

CREATE TABLE public.token_blacklist_outstandingtoken (
    id integer NOT NULL,
    token text NOT NULL,
    created_at timestamp with time zone,
    expires_at timestamp with time zone NOT NULL,
    user_id integer,
    jti character varying(255) NOT NULL
);


ALTER TABLE public.token_blacklist_outstandingtoken OWNER TO traderun;

--
-- Name: token_blacklist_outstandingtoken_id_seq; Type: SEQUENCE; Schema: public; Owner: traderun
--

CREATE SEQUENCE public.token_blacklist_outstandingtoken_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.token_blacklist_outstandingtoken_id_seq OWNER TO traderun;

--
-- Name: token_blacklist_outstandingtoken_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: traderun
--

ALTER SEQUENCE public.token_blacklist_outstandingtoken_id_seq OWNED BY public.token_blacklist_outstandingtoken.id;


--
-- Name: api_blackedlist id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_blackedlist ALTER COLUMN id SET DEFAULT nextval('public.api_blackedlist_id_seq'::regclass);


--
-- Name: api_user id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user ALTER COLUMN id SET DEFAULT nextval('public.api_user_id_seq'::regclass);


--
-- Name: api_user_groups id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user_groups ALTER COLUMN id SET DEFAULT nextval('public.api_user_groups_id_seq'::regclass);


--
-- Name: api_user_user_permissions id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user_user_permissions ALTER COLUMN id SET DEFAULT nextval('public.api_user_user_permissions_id_seq'::regclass);


--
-- Name: auth_group id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_group ALTER COLUMN id SET DEFAULT nextval('public.auth_group_id_seq'::regclass);


--
-- Name: auth_group_permissions id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_group_permissions ALTER COLUMN id SET DEFAULT nextval('public.auth_group_permissions_id_seq'::regclass);


--
-- Name: auth_permission id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_permission ALTER COLUMN id SET DEFAULT nextval('public.auth_permission_id_seq'::regclass);


--
-- Name: django_admin_log id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_admin_log ALTER COLUMN id SET DEFAULT nextval('public.django_admin_log_id_seq'::regclass);


--
-- Name: django_content_type id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_content_type ALTER COLUMN id SET DEFAULT nextval('public.django_content_type_id_seq'::regclass);


--
-- Name: django_migrations id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_migrations ALTER COLUMN id SET DEFAULT nextval('public.django_migrations_id_seq'::regclass);


--
-- Name: django_site id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_site ALTER COLUMN id SET DEFAULT nextval('public.django_site_id_seq'::regclass);


--
-- Name: orders_deliveryoptions id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_deliveryoptions ALTER COLUMN id SET DEFAULT nextval('public.orders_deliveryoptions_id_seq'::regclass);


--
-- Name: orders_order id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_order ALTER COLUMN id SET DEFAULT nextval('public.orders_order_id_seq'::regclass);


--
-- Name: orders_orderitem id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_orderitem ALTER COLUMN id SET DEFAULT nextval('public.orders_orderitem_id_seq'::regclass);


--
-- Name: orders_tracks id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_tracks ALTER COLUMN id SET DEFAULT nextval('public.orders_tracks_id_seq'::regclass);


--
-- Name: shop_category id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_category ALTER COLUMN id SET DEFAULT nextval('public.shop_category_id_seq'::regclass);


--
-- Name: shop_category_tags id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_category_tags ALTER COLUMN id SET DEFAULT nextval('public.shop_category_tags_id_seq'::regclass);


--
-- Name: shop_product id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_product ALTER COLUMN id SET DEFAULT nextval('public.shop_product_id_seq'::regclass);


--
-- Name: shop_productvariant id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_productvariant ALTER COLUMN id SET DEFAULT nextval('public.shop_productvariant_id_seq'::regclass);


--
-- Name: shop_servicefee id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_servicefee ALTER COLUMN id SET DEFAULT nextval('public.shop_servicefee_id_seq'::regclass);


--
-- Name: shop_store id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_store ALTER COLUMN id SET DEFAULT nextval('public.shop_store_id_seq'::regclass);


--
-- Name: shop_storeworkday id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_storeworkday ALTER COLUMN id SET DEFAULT nextval('public.shop_storeworkday_id_seq'::regclass);


--
-- Name: shop_tags id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_tags ALTER COLUMN id SET DEFAULT nextval('public.shop_tags_id_seq'::regclass);


--
-- Name: shop_workday id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_workday ALTER COLUMN id SET DEFAULT nextval('public.shop_workday_id_seq'::regclass);


--
-- Name: token_blacklist_blacklistedtoken id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.token_blacklist_blacklistedtoken ALTER COLUMN id SET DEFAULT nextval('public.token_blacklist_blacklistedtoken_id_seq'::regclass);


--
-- Name: token_blacklist_outstandingtoken id; Type: DEFAULT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.token_blacklist_outstandingtoken ALTER COLUMN id SET DEFAULT nextval('public.token_blacklist_outstandingtoken_id_seq'::regclass);


--
-- Name: api_blackedlist api_blackedlist_phone_number_key; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_blackedlist
    ADD CONSTRAINT api_blackedlist_phone_number_key UNIQUE (phone_number);


--
-- Name: api_blackedlist api_blackedlist_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_blackedlist
    ADD CONSTRAINT api_blackedlist_pkey PRIMARY KEY (id);


--
-- Name: api_user_groups api_user_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user_groups
    ADD CONSTRAINT api_user_groups_pkey PRIMARY KEY (id);


--
-- Name: api_user_groups api_user_groups_user_id_group_id_9c7ddfb5_uniq; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user_groups
    ADD CONSTRAINT api_user_groups_user_id_group_id_9c7ddfb5_uniq UNIQUE (user_id, group_id);


--
-- Name: api_user api_user_phone_number_key; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user
    ADD CONSTRAINT api_user_phone_number_key UNIQUE (phone_number);


--
-- Name: api_user api_user_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user
    ADD CONSTRAINT api_user_pkey PRIMARY KEY (id);


--
-- Name: api_user_user_permissions api_user_user_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user_user_permissions
    ADD CONSTRAINT api_user_user_permissions_pkey PRIMARY KEY (id);


--
-- Name: api_user_user_permissions api_user_user_permissions_user_id_permission_id_a06dd704_uniq; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user_user_permissions
    ADD CONSTRAINT api_user_user_permissions_user_id_permission_id_a06dd704_uniq UNIQUE (user_id, permission_id);


--
-- Name: auth_group auth_group_name_key; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_group
    ADD CONSTRAINT auth_group_name_key UNIQUE (name);


--
-- Name: auth_group_permissions auth_group_permissions_group_id_permission_id_0cd325b0_uniq; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_group_permissions
    ADD CONSTRAINT auth_group_permissions_group_id_permission_id_0cd325b0_uniq UNIQUE (group_id, permission_id);


--
-- Name: auth_group_permissions auth_group_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_group_permissions
    ADD CONSTRAINT auth_group_permissions_pkey PRIMARY KEY (id);


--
-- Name: auth_group auth_group_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_group
    ADD CONSTRAINT auth_group_pkey PRIMARY KEY (id);


--
-- Name: auth_permission auth_permission_content_type_id_codename_01ab375a_uniq; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_permission
    ADD CONSTRAINT auth_permission_content_type_id_codename_01ab375a_uniq UNIQUE (content_type_id, codename);


--
-- Name: auth_permission auth_permission_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_permission
    ADD CONSTRAINT auth_permission_pkey PRIMARY KEY (id);


--
-- Name: django_admin_log django_admin_log_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_admin_log
    ADD CONSTRAINT django_admin_log_pkey PRIMARY KEY (id);


--
-- Name: django_content_type django_content_type_app_label_model_76bd3d3b_uniq; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_content_type
    ADD CONSTRAINT django_content_type_app_label_model_76bd3d3b_uniq UNIQUE (app_label, model);


--
-- Name: django_content_type django_content_type_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_content_type
    ADD CONSTRAINT django_content_type_pkey PRIMARY KEY (id);


--
-- Name: django_dramatiq_task django_dramatiq_task_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_dramatiq_task
    ADD CONSTRAINT django_dramatiq_task_pkey PRIMARY KEY (id);


--
-- Name: django_migrations django_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_migrations
    ADD CONSTRAINT django_migrations_pkey PRIMARY KEY (id);


--
-- Name: django_session django_session_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_session
    ADD CONSTRAINT django_session_pkey PRIMARY KEY (session_key);


--
-- Name: django_site django_site_domain_a2e37b91_uniq; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_site
    ADD CONSTRAINT django_site_domain_a2e37b91_uniq UNIQUE (domain);


--
-- Name: django_site django_site_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_site
    ADD CONSTRAINT django_site_pkey PRIMARY KEY (id);


--
-- Name: orders_deliveryoptions orders_deliveryoptions_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_deliveryoptions
    ADD CONSTRAINT orders_deliveryoptions_pkey PRIMARY KEY (id);


--
-- Name: orders_deliveryoptions orders_deliveryoptions_title_key; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_deliveryoptions
    ADD CONSTRAINT orders_deliveryoptions_title_key UNIQUE (title);


--
-- Name: orders_order orders_order_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_order
    ADD CONSTRAINT orders_order_pkey PRIMARY KEY (id);


--
-- Name: orders_orderitem orders_orderitem_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_orderitem
    ADD CONSTRAINT orders_orderitem_pkey PRIMARY KEY (id);


--
-- Name: orders_tracks orders_tracks_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_tracks
    ADD CONSTRAINT orders_tracks_pkey PRIMARY KEY (id);


--
-- Name: orders_tracks orders_tracks_sherpa_id_key; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_tracks
    ADD CONSTRAINT orders_tracks_sherpa_id_key UNIQUE (sherpa_id);


--
-- Name: orders_tracks orders_tracks_title_key; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_tracks
    ADD CONSTRAINT orders_tracks_title_key UNIQUE (title);


--
-- Name: shop_category shop_category_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_category
    ADD CONSTRAINT shop_category_pkey PRIMARY KEY (id);


--
-- Name: shop_category_tags shop_category_tags_category_id_tags_id_c67e417f_uniq; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_category_tags
    ADD CONSTRAINT shop_category_tags_category_id_tags_id_c67e417f_uniq UNIQUE (category_id, tags_id);


--
-- Name: shop_category_tags shop_category_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_category_tags
    ADD CONSTRAINT shop_category_tags_pkey PRIMARY KEY (id);


--
-- Name: shop_category shop_category_title_key; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_category
    ADD CONSTRAINT shop_category_title_key UNIQUE (title);


--
-- Name: shop_product shop_product_barcode_d5b8e4af_uniq; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_product
    ADD CONSTRAINT shop_product_barcode_d5b8e4af_uniq UNIQUE (barcode);


--
-- Name: shop_product shop_product_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_product
    ADD CONSTRAINT shop_product_pkey PRIMARY KEY (id);


--
-- Name: shop_productvariant shop_productvariant_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_productvariant
    ADD CONSTRAINT shop_productvariant_pkey PRIMARY KEY (id);


--
-- Name: shop_productvariant shop_productvariant_product_id_supplier_id_7f57a2f7_uniq; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_productvariant
    ADD CONSTRAINT shop_productvariant_product_id_supplier_id_7f57a2f7_uniq UNIQUE (product_id, supplier_id);


--
-- Name: shop_servicefee shop_servicefee_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_servicefee
    ADD CONSTRAINT shop_servicefee_pkey PRIMARY KEY (id);


--
-- Name: shop_store shop_store_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_store
    ADD CONSTRAINT shop_store_pkey PRIMARY KEY (id);


--
-- Name: shop_storeworkday shop_storeworkday_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_storeworkday
    ADD CONSTRAINT shop_storeworkday_pkey PRIMARY KEY (id);


--
-- Name: shop_tags shop_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_tags
    ADD CONSTRAINT shop_tags_pkey PRIMARY KEY (id);


--
-- Name: shop_tags shop_tags_title_key; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_tags
    ADD CONSTRAINT shop_tags_title_key UNIQUE (title);


--
-- Name: shop_workday shop_workday_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_workday
    ADD CONSTRAINT shop_workday_pkey PRIMARY KEY (id);


--
-- Name: token_blacklist_blacklistedtoken token_blacklist_blacklistedtoken_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.token_blacklist_blacklistedtoken
    ADD CONSTRAINT token_blacklist_blacklistedtoken_pkey PRIMARY KEY (id);


--
-- Name: token_blacklist_blacklistedtoken token_blacklist_blacklistedtoken_token_id_key; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.token_blacklist_blacklistedtoken
    ADD CONSTRAINT token_blacklist_blacklistedtoken_token_id_key UNIQUE (token_id);


--
-- Name: token_blacklist_outstandingtoken token_blacklist_outstandingtoken_jti_hex_d9bdf6f7_uniq; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.token_blacklist_outstandingtoken
    ADD CONSTRAINT token_blacklist_outstandingtoken_jti_hex_d9bdf6f7_uniq UNIQUE (jti);


--
-- Name: token_blacklist_outstandingtoken token_blacklist_outstandingtoken_pkey; Type: CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.token_blacklist_outstandingtoken
    ADD CONSTRAINT token_blacklist_outstandingtoken_pkey PRIMARY KEY (id);


--
-- Name: api_blackedlist_phone_number_251722a9_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX api_blackedlist_phone_number_251722a9_like ON public.api_blackedlist USING btree (phone_number varchar_pattern_ops);


--
-- Name: api_user_groups_group_id_3af85785; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX api_user_groups_group_id_3af85785 ON public.api_user_groups USING btree (group_id);


--
-- Name: api_user_groups_user_id_a5ff39fa; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX api_user_groups_user_id_a5ff39fa ON public.api_user_groups USING btree (user_id);


--
-- Name: api_user_phone_number_7fd8ad9a_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX api_user_phone_number_7fd8ad9a_like ON public.api_user USING btree (phone_number varchar_pattern_ops);


--
-- Name: api_user_point_id; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX api_user_point_id ON public.api_user USING gist (point);


--
-- Name: api_user_user_permissions_permission_id_305b7fea; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX api_user_user_permissions_permission_id_305b7fea ON public.api_user_user_permissions USING btree (permission_id);


--
-- Name: api_user_user_permissions_user_id_f3945d65; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX api_user_user_permissions_user_id_f3945d65 ON public.api_user_user_permissions USING btree (user_id);


--
-- Name: auth_group_name_a6ea08ec_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX auth_group_name_a6ea08ec_like ON public.auth_group USING btree (name varchar_pattern_ops);


--
-- Name: auth_group_permissions_group_id_b120cbf9; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX auth_group_permissions_group_id_b120cbf9 ON public.auth_group_permissions USING btree (group_id);


--
-- Name: auth_group_permissions_permission_id_84c5c92e; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX auth_group_permissions_permission_id_84c5c92e ON public.auth_group_permissions USING btree (permission_id);


--
-- Name: auth_permission_content_type_id_2f476e4b; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX auth_permission_content_type_id_2f476e4b ON public.auth_permission USING btree (content_type_id);


--
-- Name: django_admin_log_content_type_id_c4bce8eb; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX django_admin_log_content_type_id_c4bce8eb ON public.django_admin_log USING btree (content_type_id);


--
-- Name: django_admin_log_user_id_c564eba6; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX django_admin_log_user_id_c564eba6 ON public.django_admin_log USING btree (user_id);


--
-- Name: django_dramatiq_task_updated_at_bb623596; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX django_dramatiq_task_updated_at_bb623596 ON public.django_dramatiq_task USING btree (updated_at);


--
-- Name: django_session_expire_date_a5c62663; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX django_session_expire_date_a5c62663 ON public.django_session USING btree (expire_date);


--
-- Name: django_session_session_key_c0390e0f_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX django_session_session_key_c0390e0f_like ON public.django_session USING btree (session_key varchar_pattern_ops);


--
-- Name: django_site_domain_a2e37b91_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX django_site_domain_a2e37b91_like ON public.django_site USING btree (domain varchar_pattern_ops);


--
-- Name: orders_deliveryoptions_title_4edc38e4_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX orders_deliveryoptions_title_4edc38e4_like ON public.orders_deliveryoptions USING btree (title varchar_pattern_ops);


--
-- Name: orders_order_client_id_67117a15; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX orders_order_client_id_67117a15 ON public.orders_order USING btree (client_id);


--
-- Name: orders_order_delivery_options_id_24e8d73e; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX orders_order_delivery_options_id_24e8d73e ON public.orders_order USING btree (delivery_options_id);


--
-- Name: orders_order_store_id_138e1a80; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX orders_order_store_id_138e1a80 ON public.orders_order USING btree (store_id);


--
-- Name: orders_order_supplier_id_767ee7f9; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX orders_order_supplier_id_767ee7f9 ON public.orders_order USING btree (supplier_id);


--
-- Name: orders_order_track_order_id_12b41765; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX orders_order_track_order_id_12b41765 ON public.orders_order USING btree (track_order_id);


--
-- Name: orders_orderitem_order_id_fe61a34d; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX orders_orderitem_order_id_fe61a34d ON public.orders_orderitem USING btree (order_id);


--
-- Name: orders_orderitem_product_id_afe4254a; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX orders_orderitem_product_id_afe4254a ON public.orders_orderitem USING btree (product_id);


--
-- Name: orders_tracks_title_506f9fd4_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX orders_tracks_title_506f9fd4_like ON public.orders_tracks USING btree (title varchar_pattern_ops);


--
-- Name: shop_category_parent_id_901626c9; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_category_parent_id_901626c9 ON public.shop_category USING btree (parent_id);


--
-- Name: shop_category_tags_category_id_e8428704; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_category_tags_category_id_e8428704 ON public.shop_category_tags USING btree (category_id);


--
-- Name: shop_category_tags_tags_id_c8a02750; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_category_tags_tags_id_c8a02750 ON public.shop_category_tags USING btree (tags_id);


--
-- Name: shop_category_title_e590a1a3_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_category_title_e590a1a3_like ON public.shop_category USING btree (title varchar_pattern_ops);


--
-- Name: shop_category_tree_id_c48d9e64; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_category_tree_id_c48d9e64 ON public.shop_category USING btree (tree_id);


--
-- Name: shop_product_barcode_d5b8e4af_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_product_barcode_d5b8e4af_like ON public.shop_product USING btree (barcode varchar_pattern_ops);


--
-- Name: shop_product_category_id_14d7eea8; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_product_category_id_14d7eea8 ON public.shop_product USING btree (category_id);


--
-- Name: shop_productvariant_product_id_3268ff6d; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_productvariant_product_id_3268ff6d ON public.shop_productvariant USING btree (product_id);


--
-- Name: shop_productvariant_supplier_id_669f2362; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_productvariant_supplier_id_669f2362 ON public.shop_productvariant USING btree (supplier_id);


--
-- Name: shop_store_point_id; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_store_point_id ON public.shop_store USING gist (point);


--
-- Name: shop_store_supplier_id_6a4aa6eb; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_store_supplier_id_6a4aa6eb ON public.shop_store USING btree (supplier_id);


--
-- Name: shop_storeworkday_store_id_0814ad6c; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_storeworkday_store_id_0814ad6c ON public.shop_storeworkday USING btree (store_id);


--
-- Name: shop_storeworkday_workday_id_683c2bb1; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_storeworkday_workday_id_683c2bb1 ON public.shop_storeworkday USING btree (workday_id);


--
-- Name: shop_tags_title_ec49ba8e_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX shop_tags_title_ec49ba8e_like ON public.shop_tags USING btree (title varchar_pattern_ops);


--
-- Name: token_blacklist_outstandingtoken_jti_hex_d9bdf6f7_like; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX token_blacklist_outstandingtoken_jti_hex_d9bdf6f7_like ON public.token_blacklist_outstandingtoken USING btree (jti varchar_pattern_ops);


--
-- Name: token_blacklist_outstandingtoken_user_id_83bc629a; Type: INDEX; Schema: public; Owner: traderun
--

CREATE INDEX token_blacklist_outstandingtoken_user_id_83bc629a ON public.token_blacklist_outstandingtoken USING btree (user_id);


--
-- Name: api_user_groups api_user_groups_group_id_3af85785_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user_groups
    ADD CONSTRAINT api_user_groups_group_id_3af85785_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES public.auth_group(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: api_user_groups api_user_groups_user_id_a5ff39fa_fk_api_user_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user_groups
    ADD CONSTRAINT api_user_groups_user_id_a5ff39fa_fk_api_user_id FOREIGN KEY (user_id) REFERENCES public.api_user(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: api_user_user_permissions api_user_user_permis_permission_id_305b7fea_fk_auth_perm; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user_user_permissions
    ADD CONSTRAINT api_user_user_permis_permission_id_305b7fea_fk_auth_perm FOREIGN KEY (permission_id) REFERENCES public.auth_permission(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: api_user_user_permissions api_user_user_permissions_user_id_f3945d65_fk_api_user_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.api_user_user_permissions
    ADD CONSTRAINT api_user_user_permissions_user_id_f3945d65_fk_api_user_id FOREIGN KEY (user_id) REFERENCES public.api_user(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: auth_group_permissions auth_group_permissio_permission_id_84c5c92e_fk_auth_perm; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_group_permissions
    ADD CONSTRAINT auth_group_permissio_permission_id_84c5c92e_fk_auth_perm FOREIGN KEY (permission_id) REFERENCES public.auth_permission(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: auth_group_permissions auth_group_permissions_group_id_b120cbf9_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_group_permissions
    ADD CONSTRAINT auth_group_permissions_group_id_b120cbf9_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES public.auth_group(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: auth_permission auth_permission_content_type_id_2f476e4b_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.auth_permission
    ADD CONSTRAINT auth_permission_content_type_id_2f476e4b_fk_django_co FOREIGN KEY (content_type_id) REFERENCES public.django_content_type(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: django_admin_log django_admin_log_content_type_id_c4bce8eb_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_admin_log
    ADD CONSTRAINT django_admin_log_content_type_id_c4bce8eb_fk_django_co FOREIGN KEY (content_type_id) REFERENCES public.django_content_type(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: django_admin_log django_admin_log_user_id_c564eba6_fk_api_user_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.django_admin_log
    ADD CONSTRAINT django_admin_log_user_id_c564eba6_fk_api_user_id FOREIGN KEY (user_id) REFERENCES public.api_user(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: orders_order orders_order_client_id_67117a15_fk_api_user_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_order
    ADD CONSTRAINT orders_order_client_id_67117a15_fk_api_user_id FOREIGN KEY (client_id) REFERENCES public.api_user(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: orders_order orders_order_delivery_options_id_24e8d73e_fk_orders_de; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_order
    ADD CONSTRAINT orders_order_delivery_options_id_24e8d73e_fk_orders_de FOREIGN KEY (delivery_options_id) REFERENCES public.orders_deliveryoptions(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: orders_order orders_order_store_id_138e1a80_fk_shop_store_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_order
    ADD CONSTRAINT orders_order_store_id_138e1a80_fk_shop_store_id FOREIGN KEY (store_id) REFERENCES public.shop_store(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: orders_order orders_order_supplier_id_767ee7f9_fk_api_user_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_order
    ADD CONSTRAINT orders_order_supplier_id_767ee7f9_fk_api_user_id FOREIGN KEY (supplier_id) REFERENCES public.api_user(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: orders_order orders_order_track_order_id_12b41765_fk_orders_tracks_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_order
    ADD CONSTRAINT orders_order_track_order_id_12b41765_fk_orders_tracks_id FOREIGN KEY (track_order_id) REFERENCES public.orders_tracks(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: orders_orderitem orders_orderitem_order_id_fe61a34d_fk_orders_order_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_orderitem
    ADD CONSTRAINT orders_orderitem_order_id_fe61a34d_fk_orders_order_id FOREIGN KEY (order_id) REFERENCES public.orders_order(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: orders_orderitem orders_orderitem_product_id_afe4254a_fk_shop_product_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.orders_orderitem
    ADD CONSTRAINT orders_orderitem_product_id_afe4254a_fk_shop_product_id FOREIGN KEY (product_id) REFERENCES public.shop_product(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: shop_category shop_category_parent_id_901626c9_fk_shop_category_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_category
    ADD CONSTRAINT shop_category_parent_id_901626c9_fk_shop_category_id FOREIGN KEY (parent_id) REFERENCES public.shop_category(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: shop_category_tags shop_category_tags_category_id_e8428704_fk_shop_category_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_category_tags
    ADD CONSTRAINT shop_category_tags_category_id_e8428704_fk_shop_category_id FOREIGN KEY (category_id) REFERENCES public.shop_category(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: shop_category_tags shop_category_tags_tags_id_c8a02750_fk_shop_tags_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_category_tags
    ADD CONSTRAINT shop_category_tags_tags_id_c8a02750_fk_shop_tags_id FOREIGN KEY (tags_id) REFERENCES public.shop_tags(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: shop_product shop_product_category_id_14d7eea8_fk_shop_category_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_product
    ADD CONSTRAINT shop_product_category_id_14d7eea8_fk_shop_category_id FOREIGN KEY (category_id) REFERENCES public.shop_category(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: shop_productvariant shop_productvariant_product_id_3268ff6d_fk_shop_product_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_productvariant
    ADD CONSTRAINT shop_productvariant_product_id_3268ff6d_fk_shop_product_id FOREIGN KEY (product_id) REFERENCES public.shop_product(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: shop_productvariant shop_productvariant_supplier_id_669f2362_fk_api_user_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_productvariant
    ADD CONSTRAINT shop_productvariant_supplier_id_669f2362_fk_api_user_id FOREIGN KEY (supplier_id) REFERENCES public.api_user(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: shop_store shop_store_supplier_id_6a4aa6eb_fk_api_user_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_store
    ADD CONSTRAINT shop_store_supplier_id_6a4aa6eb_fk_api_user_id FOREIGN KEY (supplier_id) REFERENCES public.api_user(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: shop_storeworkday shop_storeworkday_store_id_0814ad6c_fk_shop_store_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_storeworkday
    ADD CONSTRAINT shop_storeworkday_store_id_0814ad6c_fk_shop_store_id FOREIGN KEY (store_id) REFERENCES public.shop_store(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: shop_storeworkday shop_storeworkday_workday_id_683c2bb1_fk_shop_workday_id; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.shop_storeworkday
    ADD CONSTRAINT shop_storeworkday_workday_id_683c2bb1_fk_shop_workday_id FOREIGN KEY (workday_id) REFERENCES public.shop_workday(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: token_blacklist_blacklistedtoken token_blacklist_blac_token_id_3cc7fe56_fk_token_bla; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.token_blacklist_blacklistedtoken
    ADD CONSTRAINT token_blacklist_blac_token_id_3cc7fe56_fk_token_bla FOREIGN KEY (token_id) REFERENCES public.token_blacklist_outstandingtoken(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: token_blacklist_outstandingtoken token_blacklist_outs_user_id_83bc629a_fk_api_user_; Type: FK CONSTRAINT; Schema: public; Owner: traderun
--

ALTER TABLE ONLY public.token_blacklist_outstandingtoken
    ADD CONSTRAINT token_blacklist_outs_user_id_83bc629a_fk_api_user_ FOREIGN KEY (user_id) REFERENCES public.api_user(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
--

