[arvados] created: 2.5.0-3-ge219f76f6
git repository hosting
git at public.arvados.org
Mon Jan 2 15:16:21 UTC 2023
at e219f76f6a8fc11eabb1db7bf0423a0436c40328 (commit)
commit e219f76f6a8fc11eabb1db7bf0423a0436c40328
Author: Tom Clegg <tom at curii.com>
Date: Mon Jan 2 10:11:55 2023 -0500
19890: Use 64 bit ints for id columns.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/services/api/db/migrate/20221230155924_bigint_id.rb b/services/api/db/migrate/20221230155924_bigint_id.rb
new file mode 100644
index 000000000..20791ae01
--- /dev/null
+++ b/services/api/db/migrate/20221230155924_bigint_id.rb
@@ -0,0 +1,37 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+class BigintId < ActiveRecord::Migration[5.2]
+ disable_ddl_transaction!
+ def up
+ change_column :api_client_authorizations, :id, :bigint
+ change_column :api_client_authorizations, :api_client_id, :bigint
+ change_column :api_client_authorizations, :user_id, :bigint
+ change_column :api_clients, :id, :bigint
+ change_column :authorized_keys, :id, :bigint
+ change_column :collections, :id, :bigint
+ change_column :container_requests, :id, :bigint
+ change_column :containers, :id, :bigint
+ change_column :groups, :id, :bigint
+ change_column :humans, :id, :bigint
+ change_column :job_tasks, :id, :bigint
+ change_column :jobs, :id, :bigint
+ change_column :keep_disks, :id, :bigint
+ change_column :keep_services, :id, :bigint
+ change_column :links, :id, :bigint
+ change_column :logs, :id, :bigint
+ change_column :nodes, :id, :bigint
+ change_column :users, :id, :bigint
+ change_column :pipeline_instances, :id, :bigint
+ change_column :pipeline_templates, :id, :bigint
+ change_column :repositories, :id, :bigint
+ change_column :specimens, :id, :bigint
+ change_column :traits, :id, :bigint
+ change_column :virtual_machines, :id, :bigint
+ change_column :workflows, :id, :bigint
+ end
+
+ def down
+ end
+end
diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql
index 45559757a..9f0e30fc4 100644
--- a/services/api/db/structure.sql
+++ b/services/api/db/structure.sql
@@ -259,10 +259,10 @@ SET default_tablespace = '';
--
CREATE TABLE public.api_client_authorizations (
- id integer NOT NULL,
+ id bigint NOT NULL,
api_token character varying(255) NOT NULL,
- api_client_id integer NOT NULL,
- user_id integer NOT NULL,
+ api_client_id bigint NOT NULL,
+ user_id bigint NOT NULL,
created_by_ip_address character varying(255),
last_used_by_ip_address character varying(255),
last_used_at timestamp without time zone,
@@ -299,7 +299,7 @@ ALTER SEQUENCE public.api_client_authorizations_id_seq OWNED BY public.api_clien
--
CREATE TABLE public.api_clients (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
modified_by_client_uuid character varying(255),
@@ -349,7 +349,7 @@ CREATE TABLE public.ar_internal_metadata (
--
CREATE TABLE public.authorized_keys (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255) NOT NULL,
owner_uuid character varying(255) NOT NULL,
modified_by_client_uuid character varying(255),
@@ -389,7 +389,7 @@ ALTER SEQUENCE public.authorized_keys_id_seq OWNED BY public.authorized_keys.id;
--
CREATE TABLE public.collections (
- id integer NOT NULL,
+ id bigint NOT NULL,
owner_uuid character varying(255),
created_at timestamp without time zone NOT NULL,
modified_by_client_uuid character varying(255),
@@ -444,7 +444,7 @@ ALTER SEQUENCE public.collections_id_seq OWNED BY public.collections.id;
--
CREATE TABLE public.container_requests (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
created_at timestamp without time zone NOT NULL,
@@ -508,7 +508,7 @@ ALTER SEQUENCE public.container_requests_id_seq OWNED BY public.container_reques
--
CREATE TABLE public.containers (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
created_at timestamp without time zone NOT NULL,
@@ -583,7 +583,7 @@ CREATE TABLE public.frozen_groups (
--
CREATE TABLE public.groups (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
created_at timestamp without time zone NOT NULL,
@@ -626,7 +626,7 @@ ALTER SEQUENCE public.groups_id_seq OWNED BY public.groups.id;
--
CREATE TABLE public.humans (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255) NOT NULL,
owner_uuid character varying(255) NOT NULL,
modified_by_client_uuid character varying(255),
@@ -662,7 +662,7 @@ ALTER SEQUENCE public.humans_id_seq OWNED BY public.humans.id;
--
CREATE TABLE public.job_tasks (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
modified_by_client_uuid character varying(255),
@@ -726,7 +726,7 @@ ALTER SEQUENCE public.job_tasks_qsequence_seq OWNED BY public.job_tasks.qsequenc
--
CREATE TABLE public.jobs (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
modified_by_client_uuid character varying(255),
@@ -787,7 +787,7 @@ ALTER SEQUENCE public.jobs_id_seq OWNED BY public.jobs.id;
--
CREATE TABLE public.keep_disks (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255) NOT NULL,
owner_uuid character varying(255) NOT NULL,
modified_by_client_uuid character varying(255),
@@ -833,7 +833,7 @@ ALTER SEQUENCE public.keep_disks_id_seq OWNED BY public.keep_disks.id;
--
CREATE TABLE public.keep_services (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255) NOT NULL,
owner_uuid character varying(255) NOT NULL,
modified_by_client_uuid character varying(255),
@@ -873,7 +873,7 @@ ALTER SEQUENCE public.keep_services_id_seq OWNED BY public.keep_services.id;
--
CREATE TABLE public.links (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
created_at timestamp without time zone NOT NULL,
@@ -913,7 +913,7 @@ ALTER SEQUENCE public.links_id_seq OWNED BY public.links.id;
--
CREATE TABLE public.logs (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
modified_by_client_uuid character varying(255),
@@ -966,7 +966,7 @@ CREATE TABLE public.materialized_permissions (
--
CREATE TABLE public.nodes (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
created_at timestamp without time zone NOT NULL,
@@ -1010,7 +1010,7 @@ ALTER SEQUENCE public.nodes_id_seq OWNED BY public.nodes.id;
--
CREATE TABLE public.users (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255) NOT NULL,
created_at timestamp without time zone NOT NULL,
@@ -1073,7 +1073,7 @@ UNION ALL
--
CREATE TABLE public.pipeline_instances (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
created_at timestamp without time zone NOT NULL,
@@ -1117,7 +1117,7 @@ ALTER SEQUENCE public.pipeline_instances_id_seq OWNED BY public.pipeline_instanc
--
CREATE TABLE public.pipeline_templates (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
created_at timestamp without time zone NOT NULL,
@@ -1155,7 +1155,7 @@ ALTER SEQUENCE public.pipeline_templates_id_seq OWNED BY public.pipeline_templat
--
CREATE TABLE public.repositories (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255) NOT NULL,
owner_uuid character varying(255) NOT NULL,
modified_by_client_uuid character varying(255),
@@ -1200,7 +1200,7 @@ CREATE TABLE public.schema_migrations (
--
CREATE TABLE public.specimens (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
created_at timestamp without time zone NOT NULL,
@@ -1237,7 +1237,7 @@ ALTER SEQUENCE public.specimens_id_seq OWNED BY public.specimens.id;
--
CREATE TABLE public.traits (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255) NOT NULL,
owner_uuid character varying(255) NOT NULL,
modified_by_client_uuid character varying(255),
@@ -1303,7 +1303,7 @@ ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
--
CREATE TABLE public.virtual_machines (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255) NOT NULL,
owner_uuid character varying(255) NOT NULL,
modified_by_client_uuid character varying(255),
@@ -1339,7 +1339,7 @@ ALTER SEQUENCE public.virtual_machines_id_seq OWNED BY public.virtual_machines.i
--
CREATE TABLE public.workflows (
- id integer NOT NULL,
+ id bigint NOT NULL,
uuid character varying(255),
owner_uuid character varying(255),
created_at timestamp without time zone NOT NULL,
@@ -3185,5 +3185,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20220401153101'),
('20220505112900'),
('20220726034131'),
-('20220804133317');
+('20220804133317'),
+('20221230155924');
+
diff --git a/services/api/test/unit/user_test.rb b/services/api/test/unit/user_test.rb
index 12384cba9..7e19ad582 100644
--- a/services/api/test/unit/user_test.rb
+++ b/services/api/test/unit/user_test.rb
@@ -805,4 +805,10 @@ class UserTest < ActiveSupport::TestCase
assert_nil user.identity_url
end
+ test "id overflows int32" do
+ uuid = users(:active).uuid
+ ActiveRecord::Base.connection.execute "update users set id=333222111000 where uuid='#{uuid}'"
+ u = User.find_by_uuid(uuid)
+ assert_equal 333222111000, u.id
+ end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list