-CREATE TABLE public.oauth_tokens (
- id integer NOT NULL,
- user_id integer,
- type character varying(20),
- client_application_id integer,
- token character varying(50),
- secret character varying(50),
- authorized_at timestamp without time zone,
- invalidated_at timestamp without time zone,
- created_at timestamp without time zone,
- updated_at timestamp without time zone,
- allow_read_prefs boolean DEFAULT false NOT NULL,
- allow_write_prefs boolean DEFAULT false NOT NULL,
- allow_write_diary boolean DEFAULT false NOT NULL,
- allow_write_api boolean DEFAULT false NOT NULL,
- allow_read_gpx boolean DEFAULT false NOT NULL,
- allow_write_gpx boolean DEFAULT false NOT NULL,
- callback_url character varying,
- verifier character varying(20),
- scope character varying,
- valid_to timestamp without time zone,
- allow_write_notes boolean DEFAULT false NOT NULL
+CREATE TABLE public.oauth_access_tokens (
+ id bigint NOT NULL,
+ resource_owner_id bigint,
+ application_id bigint NOT NULL,
+ token character varying NOT NULL,
+ refresh_token character varying,
+ expires_in integer,
+ revoked_at timestamp without time zone,
+ created_at timestamp without time zone NOT NULL,
+ scopes character varying,
+ previous_refresh_token character varying DEFAULT ''::character varying NOT NULL
+);
+
+
+--
+-- Name: oauth_access_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.oauth_access_tokens_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: oauth_access_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.oauth_access_tokens_id_seq OWNED BY public.oauth_access_tokens.id;
+
+
+--
+-- Name: oauth_applications; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.oauth_applications (
+ id bigint NOT NULL,
+ owner_type character varying NOT NULL,
+ owner_id bigint NOT NULL,
+ name character varying NOT NULL,
+ uid character varying NOT NULL,
+ secret character varying NOT NULL,
+ redirect_uri text NOT NULL,
+ scopes character varying DEFAULT ''::character varying NOT NULL,
+ confidential boolean DEFAULT true NOT NULL,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL
+);
+
+
+--
+-- Name: oauth_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.oauth_applications_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: oauth_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.oauth_applications_id_seq OWNED BY public.oauth_applications.id;
+
+
+--
+-- Name: oauth_openid_requests; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.oauth_openid_requests (
+ id bigint NOT NULL,
+ access_grant_id bigint NOT NULL,
+ nonce character varying NOT NULL