AMD64
Ruby: 3.2.2
Git
Scroll to End of Log
0.00s0.13s0.09s0.06sTopworker_info1Worker information2hostname: e02e1454-43dd-4748-a7d7-ceb933237da2@1.worker-n2-com-779d777f7b-hxsb6.gce-production-13version: 6.2.22 https://github.com/travis-ci/worker/tree/858cb91994a513269f2fe9782c15fc113e9662314instance: travis-job-a1c75e5b-a9e3-42b1-8913-ce5378c3598a travis-ci-sardonyx-xenial-1684402799-0876f6f0 (via amqp)5startup: 6.340543708ssystem_info7Build system information8Build language: ruby9Build dist: xenial10Build id: 26916078611Job id: 61843205412Runtime kernel version: 4.15.0-1098-gcp13travis-build version: f3de9fb714Build image provisioning date and time15Thu May 18 10:07:51 UTC 202316Operating System Details17Distributor ID: Ubuntu18Description: Ubuntu 16.04.7 LTS19Release: 16.0420Codename: xenial21Systemd Version22systemd 22923Cookbooks Version24d19e5ff https://github.com/travis-ci/travis-cookbooks/tree/d19e5ff25git version26git version 2.40.127bash version28GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)29gcc version30gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 2016060931docker version32Client: Docker Engine - Community33 Version: 20.10.734 API version: 1.4135 Go version: go1.13.1536 Git commit: f0df35037 Built: Wed Jun 2 11:56:47 202138 OS/Arch: linux/amd6439 Context: default40 Experimental: true42Server: Docker Engine - Community43 Engine:44 Version: 20.10.745 API version: 1.41 (minimum version 1.12)46 Go version: go1.13.1547 Git commit: b0f5bc348 Built: Wed Jun 2 11:54:58 202149 OS/Arch: linux/amd6450 Experimental: false51 containerd:52 Version: 1.4.653 GitCommit: d71fcd7d8303cbf684402823e425e9dd2e99285d54 runc:55 Version: 1.0.0-rc9556 GitCommit: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b757 docker-init:58 Version: 0.19.059 GitCommit: de40ad060clang version61clang version 7.0.0 (tags/RELEASE_700/final)62jq version63jq-1.664bats version65Bats 0.4.066shellcheck version670.7.268shfmt version69v3.2.170ccache version713.2.472cmake version73cmake version 3.26.374heroku version75heroku/8.1.3 linux-x64 node-v16.19.076imagemagick version77Version: ImageMagick 6.8.9-9 Q16 x86_64 2020-12-04 http://www.imagemagick.org78md5deep version794.480mercurial version81version 5.9.382mysql version83mysql Ver 14.14 Distrib 5.7.33, for Linux (x86_64) using EditLine wrapper84openssl version85OpenSSL 1.0.2g 1 Mar 201686packer version871.7.588postgresql client version89psql (PostgreSQL) 10.17 (Ubuntu 10.17-1.pgdg16.04+1)90ragel version91Ragel State Machine Compiler version 6.8 Feb 201392sudo version931.8.1694gzip version95gzip 1.696zip version97Zip 3.098vim version99VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 13 2020 16:04:38)100iptables version101iptables v1.6.0102curl version103curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3104wget version105GNU Wget 1.17.1 built on linux-gnu.106rsync version107rsync version 3.1.1 protocol version 31108gimme version109v1.5.4110nvm version1110.39.3112perlbrew version113/home/travis/perl5/perlbrew/bin/perlbrew - App::perlbrew/0.95114phpenv version115rbenv 1.2.0116rvm version117rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]118default ruby version119ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]120default python version121Python 3.7.13122CouchDB version123couchdb 1.6.1124ElasticSearch version1257.16.3126Installed Firefox version127firefox 63.0.1128MongoDB version129MongoDB 4.4.21130PhantomJS version1312.1.1132Pre-installed PostgreSQL versions1339.4.261349.5.251359.6.22136Redis version137redis-server 6.0.6138Pre-installed Go versions1391.18.4140ant version141Apache Ant(TM) version 1.9.6 compiled on July 20 2018142mvn version143Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)144gradle version145Gradle 7.5.1!146lein version147Leiningen 2.10.0 on Java 11.0.15.1 OpenJDK 64-Bit Server VM148Pre-installed Node.js versions149v10.24.1150v12.22.12151v14.21.3152v16.15153v16.16.0154v16.20.0155v18.16.0156v4.9.1157v6.17.1158v8.17.0159phpenv versions160 system161 7.4162* 7.4.30 (set by /home/travis/.phpenv/version)163 hhvm-stable164 hhvm165composer --version166Composer version 2.3.7 2022-06-06 16:43:28167Pre-installed Ruby versions168ruby-2.7.6169ruby-3.0.4170ruby-3.1.21730.00s0.02s0.00s0.01s0.27s0.00s0.00s0.00s0.01s0.00s0.09s0.00s0.84s0.00s0.10s6.03s0.00s3.61s0.00s2.47sdocker_mtu_and_registry_mirrorsresolvconfsnap174Installing 1 Snaps1762024-02-28T06:57:54Z INFO Waiting for automatic snapd restart...177core 16-2.61.1 from Canonical* installed179docker (beta) 24.0.5 from Canonical** installed181Name Version Rev Tracking Publisher Notes182core 16-2.61.1 16574 latest/stable canonical** core183core22 20240111 1122 latest/stable canonical** base184docker 24.0.5 2915 latest/beta canonical** -git.checkout1900.01s0.68s$ git clone --depth=50 https://github.com/travis-ci/travis-migrations.git travis-ci/travis-migrations191Cloning into 'travis-ci/travis-migrations'...192$ cd travis-ci/travis-migrations194From https://github.com/travis-ci/travis-migrations195 * branch refs/pull/285/merge -> FETCH_HEAD196$ git checkout -qf FETCH_HEAD1980.01s199Setting environment variables from repository settings200$ export QUAY_ROBOT_HANDLE=[secure]201$ export QUAY_ROBOT_TOKEN=[secure]202$ export ARTIFACTS_BUCKET=travis-migrations-structure-dumps203$ export ARTIFACTS_SECRET=[secure]204$ export ARTIFACTS_KEY=[secure]rvm207Downloading https://get.rvm.io208Downloading https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer.asc209Verifying /home/travis/.rvm/archives/rvm-installer.asc210gpg: Signature made Tue 21 Feb 2023 11:35:16 PM UTC using RSA key ID 39499BDB211gpg: Good signature from "Piotr Kuczynski <piotr.kuczynski@gmail.com>" [unknown]212gpg: WARNING: This key is not certified with a trusted signature!213gpg: There is no indication that the signature belongs to the owner.214Primary key fingerprint: 7D2B AF1C F37B 13E2 069D 6956 105B D0E7 3949 9BDB215GPG verified '/home/travis/.rvm/archives/rvm-installer'216Downloading https://github.com/rvm/rvm/archive/master.tar.gz217Upgrading the RVM installation in /home/travis/.rvm/218 RVM PATH line found in /home/travis/.mkshrc /home/travis/.profile /home/travis/.zshrc.219 RVM PATH line not found for Bash, rerun this command with '--auto-dotfiles' flag to fix it.220 RVM sourcing line found in /home/travis/.profile /home/travis/.bashrc /home/travis/.zlogin.221Upgrade of RVM in /home/travis/.rvm/ is complete.223<warn>Thanks for installing RVM 🙏</warn>224Please consider donating to our open collective to help us maintain RVM.226👉 Donate: <code>https://opencollective.com/rvm/donate</code>229RVM reloaded!231curl: (22) The requested URL returned error: 404 Not Found232Required ruby-3.2.2 is not installed - installing.233curl: (22) The requested URL returned error: 404 Not Found234Searching for binary rubies, this might take some time.235Found remote file https://rubies.travis-ci.org/ubuntu/16.04/x86_64/ruby-3.2.2.tar.bz2236Checking requirements for ubuntu.237Requirements installation successful.238ruby-3.2.2 - #configure239ruby-3.2.2 - #download240 % Total % Received % Xferd Average Speed Time Time Time Current241 Dload Upload Total Spent Left Speed242 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0243100 27.9M 100 27.9M 0 0 18.3M 0 0:00:01 0:00:01 --:--:-- 18.3M244No checksum for downloaded archive, recording checksum in user configuration.245ruby-3.2.2 - #validate archive246ruby-3.2.2 - #extract247ruby-3.2.2 - #validate binary248ruby-3.2.2 - #setup249ruby-3.2.2 - #gemset created /home/travis/.rvm/gems/ruby-3.2.2@global250ruby-3.2.2 - #importing gemset /home/travis/.rvm/gemsets/global.gems..................................253ruby-3.2.2 - #gemset created /home/travis/.rvm/gems/ruby-3.2.2256Using /home/travis/.rvm/gems/ruby-3.2.2258$ export BUNDLE_GEMFILE=$PWD/Gemfilecache.1259Setting up build cache260$ export CASHER_DIR=${TRAVIS_HOME}/.casher263fetching PR.285/cache--linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--rvm-3.2.2--gemfile-Gemfile.tgz264found cache266creating directory /home/travis/build/travis-ci/travis-migrations/vendor/bundleruby.versions269$ ruby --version270ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]271$ rvm --version272rvm 1.29.12-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]273$ bundle --version274Bundler version 2.4.10275$ gem --version2763.4.10install.bundler282[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag283Bundler 2.4.17 is running, but your lockfile was generated with 2.4.14. Installing Bundler 2.4.14 and restarting using that version.284Fetching gem metadata from https://rubygems.org/.285Fetching bundler 2.4.14286Installing bundler 2.4.14287[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag288Using rake 13.0.6289Using concurrent-ruby 1.2.2290Using i18n 1.14.1291Using minitest 5.18.1292Using tzinfo 2.0.6293Using activesupport 7.0.6294Using builder 3.2.4295Using erubi 1.12.0296Using racc 1.7.1297Using nokogiri 1.15.2 (x86_64-linux)298Using rails-dom-testing 2.1.1299Using crass 1.0.6300Using loofah 2.21.3301Using rails-html-sanitizer 1.6.0302Using actionview 7.0.6303Using rack 2.2.7304Using rack-test 2.1.0305Using actionpack 7.0.6306Using nio4r 2.5.9307Using websocket-extensions 0.1.5308Using websocket-driver 0.7.5309Using actioncable 7.0.6310Using globalid 1.1.0311Using activejob 7.0.6312Using activemodel 7.0.6313Using activerecord 7.0.6314Using marcel 1.0.2315Using mini_mime 1.1.2316Using activestorage 7.0.6317Using date 3.3.3318Using timeout 0.4.0319Using net-protocol 0.2.1320Using net-imap 0.3.6321Using net-pop 0.1.2322Using net-smtp 0.3.3323Using mail 2.8.1324Using actionmailbox 7.0.6325Using actionmailer 7.0.6326Using actiontext 7.0.6327Using ansi 1.5.0328Using ast 2.4.2329Using aws-eventstream 1.2.0330Using aws-partitions 1.783.0331Using aws-sigv4 1.6.0332Using jmespath 1.6.2333Using aws-sdk-core 3.176.1334Using aws-sdk-kms 1.68.0335Using aws-sdk-s3 1.127.0336Using bundler 2.4.14337Using colored 1.2338Using diff-lcs 1.5.0339Using docile 1.4.0340Using json 2.6.3341Using language_server-protocol 3.17.0.3342Using method_source 1.0.0343Using parallel 1.23.0344Using parser 3.2.2.3345Using pg 1.5.3346Using thor 1.2.2347Using zeitwerk 2.6.8348Using railties 7.0.6349Using rails 7.0.6350Using rainbow 3.1.1351Using rake-notes 0.2.2352Using regexp_parser 2.8.1353Using rexml 3.2.5354Using routes 0.2.0355Using rspec-support 3.12.1356Using rspec-core 3.12.2357Using rspec-expectations 3.12.3358Using rspec-mocks 3.12.5359Using rspec 3.12.0360Using rubocop-ast 1.29.0361Using ruby-progressbar 1.13.0362Using unicode-display_width 2.4.2363Using rubocop 1.54.1364Using rubocop-capybara 2.18.0365Using rubocop-factory_bot 2.23.1366Using rubocop-performance 1.18.0367Using rubocop-rspec 2.22.0368Using simplecov-html 0.12.3369Using simplecov_json_formatter 0.1.4370Using simplecov 0.22.0371Using terminal-table 3.0.2372Using simplecov-console 0.9.1373Bundle complete! 12 Gemfile dependencies, 85 gems now installed.374Bundled gems are installed into `./vendor/bundle`before_script.1before_script.2380Repo counts381 before aggregation382 after aggregating per repo383 after aggregating all counts384 does not raise if repos are missing385 does not raise if builds are deleted before stages387set_updated_at trigger388Dropped database 'travis_test'389Created database 'travis_test'390== 201207261749 CreatePlans: migrating ========================================391-- create_table(:plans, {:id=>:integer})392 -> 0.0021s393== 201207261749 CreatePlans: migrated (0.0022s) ===============================395== 20101126174706 CreateRepositories: migrating ===============================396-- create_table(:repositories, {:id=>:integer})397 -> 0.0019s398== 20101126174706 CreateRepositories: migrated (0.0019s) ======================400== 20101126174715 CreateBuilds: migrating =====================================401-- create_table(:builds, {:id=>:integer})402 -> 0.0025s403== 20101126174715 CreateBuilds: migrated (0.0025s) ============================405== 20110109130532 DeviseCreateUsers: migrating ================================406-- create_table(:users, {:id=>:integer})407 -> 0.0017s408-- add_index(:users, :login, {:unique=>true})409 -> 0.0008s410== 20110109130532 DeviseCreateUsers: migrated (0.0025s) =======================412== 20110116155100 RepositoriesAddUsername: migrating ==========================413-- change_table(:repositories)414 -> 0.0007s415== 20110116155100 RepositoriesAddUsername: migrated (0.0008s) =================417== 20110130102621 CreateTokens: migrating =====================================418-- create_table(:tokens, {:id=>:integer})419 -> 0.0017s420== 20110130102621 CreateTokens: migrated (0.0018s) ============================422== 20110301071656 AddBuildParentIdAndConfiguration: migrating =================423-- change_table(:builds)424 -> 0.0010s425-- change_column(:builds, :number, :string)426 -> 0.0018s427-- add_index(:builds, :repository_id)428 -> 0.0005s429-- add_index(:builds, :parent_id)430 -> 0.0004s431== 20110301071656 AddBuildParentIdAndConfiguration: migrated (0.0039s) ========433== 20110316174721 RepositoriesDenormalizeLastBuildAttributes: migrating =======434-- change_table(:repositories)435 -> 0.0020s436== 20110316174721 RepositoriesDenormalizeLastBuildAttributes: migrated (0.0020s)438== 20110321075539 RepositoriesAddOwnerNameAndOwnerEmail: migrating ============439-- change_table(:repositories)440 -> 0.0012s441-- remove_column(:repositories, :username)442 -> 0.0003s443== 20110321075539 RepositoriesAddOwnerNameAndOwnerEmail: migrated (0.0016s) ===445== 20110411171936 CreateHistoriesTable: migrating =============================446-- create_table(:histories, {:id=>:integer})447 -> 0.0019s448-- add_index(:histories, [:item, :table, :month, :year])449 -> 0.0007s450== 20110411171936 CreateHistoriesTable: migrated (0.0026s) ====================452== 20110411171937 RenameHistoriesToRailsAdminHistories: migrating =============453-- remove_index(:histories, nil, {:name=>:index_histories_on_item_and_table_and_month_and_year})454 -> 0.0004s455-- rename_table(:histories, :rails_admin_histories)456 -> 0.0032s457-- add_index("rails_admin_histories", ["item", "table", "month", "year"], {:name=>"index_histories_on_item_and_table_and_month_and_year"})458 -> 0.0006s459== 20110411171937 RenameHistoriesToRailsAdminHistories: migrated (0.0054s) ====461== 20110411172518 AddAdminFlagToUser: migrating ===============================462-- change_table(:users)463 -> 0.0022s464== 20110411172518 AddAdminFlagToUser: migrated (0.0022s) ======================466== 20110413101057 BuildsAddRef: migrating =====================================467-- change_table(:builds)468 -> 0.0010s469== 20110413101057 BuildsAddRef: migrated (0.0010s) ============================471== 20110414131100 BuildsAddGithubPayload: migrating ===========================472-- change_table(:builds)473 -> 0.0006s474== 20110414131100 BuildsAddGithubPayload: migrated (0.0006s) ==================476== 20110503150504 AddGithubIdToUsersTable: migrating ==========================477-- add_column(:users, :github_id, :integer)478 -> 0.0006s479-- add_index(:users, :github_id)480 -> 0.0005s481== 20110503150504 AddGithubIdToUsersTable: migrated (0.0011s) =================483== 20110523012243 RepositoriesChangeOwnerEmailType: migrating =================484-- change_column(:repositories, :owner_email, :text)485 -> 0.0006s486== 20110523012243 RepositoriesChangeOwnerEmailType: migrated (0.0006s) ========488== 20110611203537 AddGithubOauthTokenToUser: migrating ========================489-- add_column(:users, :github_oauth_token, :string)490 -> 0.0006s491-- add_index(:users, :github_oauth_token)492 -> 0.0006s493== 20110611203537 AddGithubOauthTokenToUser: migrated (0.0012s) ===============495== 20110613210252 AddCompareUrlToBuild: migrating =============================496-- add_column(:builds, :compare_url, :string)497 -> 0.0006s498== 20110613210252 AddCompareUrlToBuild: migrated (0.0006s) ====================500== 20110615152003 BuildsRemoveJobId: migrating ================================501-- change_table(:builds)502 -> 0.0006s503== 20110615152003 BuildsRemoveJobId: migrated (0.0006s) =======================505== 20110616211744 BuildRemoveLastBuiltAt: migrating ===========================506-- change_table(:repositories)507 -> 0.0006s508== 20110616211744 BuildRemoveLastBuiltAt: migrated (0.0006s) ==================510== 20110617114728 AddMissingIndexes: migrating ================================511-- add_index(:repositories, :last_build_started_at)512 -> 0.0008s513-- add_index(:repositories, [:owner_name, :name])514 -> 0.0005s515-- add_index(:builds, [:repository_id, :parent_id, :started_at])516 -> 0.0006s517== 20110617114728 AddMissingIndexes: migrated (0.0019s) =======================519== 20110619100906 AddActiveToRepositories: migrating ==========================520-- add_column(:repositories, :is_active, :boolean)521 -> 0.0006s522== 20110619100906 AddActiveToRepositories: migrated (0.0006s) =================524== 20110729094426 StoreTokenInBuild: migrating ================================525-- add_column(:builds, :token, :string)526 -> 0.0006s527== 20110729094426 StoreTokenInBuild: migrated (0.0006s) =======================529== 20110801161819 CreateRequestsCommitsAndTasks: migrating ====================530-- change_table(:builds)531 -> 0.0013s532-- create_table(:commits, {:force=>true, :id=>:integer})533 -> 0.0021s534-- create_table(:requests, {:force=>true, :id=>:integer})535 -> 0.0022s536-- create_table(:tasks, {:force=>true, :id=>:integer})537 -> 0.0024s538-- add_index(:commits, :commit)539 -> 0.0005s540-- add_index(:builds, :commit)541 -> 0.0005s542-- add_index(:requests, :commit)543 -> 0.0004s544-- add_index(:tasks, :commit)545 -> 0.0005s546-- execute("UPDATE requests SET commit_id = (SELECT commits.id FROM commits WHERE commits.commit = requests.commit LIMIT 1)")547 -> 0.0006s548-- execute("UPDATE tasks SET commit_id = (SELECT commits.id FROM commits WHERE commits.commit = tasks.commit LIMIT 1)")549 -> 0.0004s550-- execute("DELETE FROM builds WHERE parent_id IS NOT NULL")551 -> 0.0005s552-- execute("UPDATE builds SET request_id = (SELECT requests.id FROM requests WHERE requests.commit = builds.commit LIMIT 1)")553 -> 0.0004s554-- execute("UPDATE builds SET commit_id = (SELECT commits.id FROM commits WHERE commits.commit = builds.commit LIMIT 1)")555 -> 0.0003s556-- execute("CREATE SEQUENCE shared_builds_tasks_seq CACHE 30")557 -> 0.0005s558-- execute("ALTER TABLE builds ALTER COLUMN id TYPE BIGINT")559 -> 0.0024s560-- execute("ALTER TABLE builds ALTER COLUMN id SET DEFAULT nextval('shared_builds_tasks_seq')")561 -> 0.0004s562-- execute("ALTER TABLE tasks ALTER COLUMN id TYPE BIGINT")563 -> 0.0018s564-- execute("ALTER TABLE tasks ALTER COLUMN id SET DEFAULT nextval('shared_builds_tasks_seq')")565 -> 0.0004s566-- select_value("SELECT max(id) FROM commits")567 -> 0.0005s568-- execute("SELECT setval('commits_id_seq', 1)")569 -> 0.0003s570-- select_value("SELECT max(id) FROM requests")571 -> 0.0004s572-- execute("SELECT setval('requests_id_seq', 1)")573 -> 0.0003s574-- select_value("SELECT max(id) FROM tasks")575 -> 0.0004s576-- execute("SELECT setval('tasks_id_seq', 1)")577 -> 0.0002s578-- remove_column(:builds, :parent_id)579 -> 0.0004s580-- remove_column(:builds, :commit)581 -> 0.0003s582-- remove_column(:requests, :commit)583 -> 0.0003s584-- remove_column(:tasks, :commit)585 -> 0.0004s586== 20110801161819 CreateRequestsCommitsAndTasks: migrated (0.0218s) ===========588== 20110805030147 RepositoryRenameIsActiveToActive: migrating =================589-- rename_column(:repositories, :is_active, :active)590 -> 0.0069s591== 20110805030147 RepositoryRenameIsActiveToActive: migrated (0.0069s) ========593== 20110819232908 TasksAddTags: migrating =====================================594-- add_column(:tasks, :tags, :text)595 -> 0.0008s596== 20110819232908 TasksAddTags: migrated (0.0008s) ============================598== 20110911204538 CacheOneNumberForSharedBuildsTasksSequence: migrating =======599-- execute("ALTER SEQUENCE shared_builds_tasks_seq CACHE 1 NO MAXVALUE NO CYCLE")600 -> 0.0005s601== 20110911204538 CacheOneNumberForSharedBuildsTasksSequence: migrated (0.0006s)603== 20111107134436 RenameTasksToJobs: migrating ================================604-- rename_table(:tasks, :jobs)605 -> 0.0038s606-- execute("UPDATE jobs SET type = 'Job::Test' WHERE type = 'Task::Test'")607 -> 0.0005s608-- execute("UPDATE jobs SET type = 'Job::Configure' WHERE type = 'Task::Configure'")609 -> 0.0003s610== 20111107134436 RenameTasksToJobs: migrated (0.0047s) =======================612== 20111107134437 CreateArtifacts: migrating ==================================613-- create_table(:artifacts, {:id=>:integer})614 -> 0.0028s615-- execute("UPDATE artifacts SET job_id = id")616 -> 0.0004s617-- execute("select setval('artifacts_id_seq', (select max(id) + 1 from artifacts));")618 -> 0.0004s619-- add_index(:artifacts, [:type, :job_id])620 -> 0.0007s621== 20111107134437 CreateArtifacts: migrated (0.0045s) =========================623== 20111107134438 CreateWorkers: migrating ====================================624-- create_table(:workers, {:id=>:integer})625 -> 0.0027s626-- add_index(:workers, [:name, :host])627 -> 0.0007s628== 20111107134438 CreateWorkers: migrated (0.0035s) ===========================630== 20111107134439 JobsAddRetries: migrating ===================================631-- change_table(:jobs)632 -> 0.0036s633== 20111107134439 JobsAddRetries: migrated (0.0036s) ==========================635== 20111107134440 RemoveRailsAdmin: migrating =================================636-- drop_table(:rails_admin_histories)637 -> 0.0014s638== 20111107134440 RemoveRailsAdmin: migrated (0.0015s) ========================640== 20111128235043 AddIndexesToJobs: migrating =================================641-- add_index(:jobs, [:queue, :state])642 -> 0.0010s643== 20111128235043 AddIndexesToJobs: migrated (0.0011s) ========================645== 20111129014329 AddRepositoryIdIndexToJobs: migrating =======================646-- add_index(:jobs, :repository_id)647 -> 0.0009s648== 20111129014329 AddRepositoryIdIndexToJobs: migrated (0.0009s) ==============650== 20111129022625 AddOwnerAndTypeIndexToJobs: migrating =======================651-- add_index(:jobs, [:type, :owner_id, :owner_type])652 -> 0.0010s653== 20111129022625 AddOwnerAndTypeIndexToJobs: migrated (0.0011s) ==============655== 20111201113500 WorkersAddPayloadAndLastError: migrating ====================656-- change_table(:workers)657 -> 0.0012s658== 20111201113500 WorkersAddPayloadAndLastError: migrated (0.0012s) ===========660== 20111203002341 RepositoriesAddDescriptionAndLastLanguage: migrating ========661-- change_table(:repositories)662 -> 0.0012s663-- change_table(:builds)664 -> 0.0005s665== 20111203002341 RepositoriesAddDescriptionAndLastLanguage: migrated (0.0018s)667== 20111203221720 BuildsAddArchivedAt: migrating ==============================668-- change_table(:builds)669 -> 0.0008s670== 20111203221720 BuildsAddArchivedAt: migrated (0.0008s) =====================672== 20111207093700 MimicProductionDb: migrating ================================673-- column_exists?(:users, :oauth2_uid, :integer)674 -> 0.0026s675-- column_exists?(:users, :oauth2_token, :string)676 -> 0.0019s677-- column_exists?(:repositories, :user_id, :integer)678 -> 0.0023s679== 20111207093700 MimicProductionDb: migrated (0.0069s) =======================681== 20111212103859 BuildsAddDuration: migrating ================================682-- change_table(:builds)683 -> 0.0010s684== 20111212103859 BuildsAddDuration: migrated (0.0011s) =======================686== 20111212112411 RepositoriesAddLastBuildDuration: migrating =================687-- change_table(:repositories)688 -> 0.0007s689== 20111212112411 RepositoriesAddLastBuildDuration: migrated (0.0008s) ========691== 20111214173922 CreateSslKeys: migrating ====================================692-- create_table(:ssl_keys, {:id=>:integer})693 -> 0.0028s694-- add_index("ssl_keys", ["repository_id"], {:name=>"index_ssl_key_on_repository_id"})695 -> 0.0006s696== 20111214173922 CreateSslKeys: migrated (0.0035s) ===========================698== 20120114125404 AddAllowFailureToJobs: migrating ============================699-- add_column(:jobs, :allow_failure, :boolean, {:default=>false})700 -> 0.0037s701== 20120114125404 AddAllowFailureToJobs: migrated (0.0037s) ===================703== 20120216133223 AddPullRequestFieldsToRequest: migrating ====================704-- add_column(:requests, :event_type, :string)705 -> 0.0008s706-- add_column(:requests, :comments_url, :string)707 -> 0.0004s708-- add_column(:requests, :base_commit, :string)709 -> 0.0005s710-- add_column(:requests, :head_commit, :string)711 -> 0.0004s712== 20120216133223 AddPullRequestFieldsToRequest: migrated (0.0025s) ===========714== 20120222082522 AddGravatarIdToUsers: migrating =============================715-- add_column(:users, :gravatar_id, :string)716 -> 0.0007s717== 20120222082522 AddGravatarIdToUsers: migrated (0.0007s) ====================719== 20120301131209 OrganizationsCreate: migrating ==============================720-- create_table(:organizations, {:id=>:integer})721 -> 0.0029s722== 20120301131209 OrganizationsCreate: migrated (0.0029s) =====================724== 20120304000502 JobsRenameOwnerToSource: migrating ==========================725-- change_table(:jobs)726 -> 0.0072s727== 20120304000502 JobsRenameOwnerToSource: migrated (0.0072s) =================729== 20120304000503 RepositoriesAddOwner: migrating =============================730-- change_table(:repositories)731 -> 0.0013s732== 20120304000503 RepositoriesAddOwner: migrated (0.0013s) ====================734== 20120304000504 BuildsAddOwner: migrating ===================================735-- change_table(:builds)736 -> 0.0014s737== 20120304000504 BuildsAddOwner: migrated (0.0014s) ==========================739== 20120304000505 JobsAddOwner: migrating =====================================740-- change_table(:jobs)741 -> 0.0011s742== 20120304000505 JobsAddOwner: migrated (0.0012s) ============================744== 20120304000506 RequestsAddOwner: migrating =================================745-- change_table(:requests)746 -> 0.0011s747== 20120304000506 RequestsAddOwner: migrated (0.0012s) ========================749== 20120311234933 AddLocaleToUser: migrating ==================================750-- add_column(:users, :locale, :string)751 -> 0.0007s752== 20120311234933 AddLocaleToUser: migrated (0.0007s) =========================754== 20120316123726 CreateMemberships: migrating ================================755-- create_table(:memberships, {:id=>:integer})756 -> 0.0022s757== 20120316123726 CreateMemberships: migrated (0.0022s) =======================759== 20120319170001 RepositoriesAddPrivate: migrating ===========================760-- change_table(:repositories)761 -> 0.0038s762== 20120319170001 RepositoriesAddPrivate: migrated (0.0038s) ==================764== 20120324104051 CreateUrls: migrating =======================================765-- create_table(:urls, {:id=>:integer})766 -> 0.0028s767== 20120324104051 CreateUrls: migrated (0.0029s) ==============================769== 20120505165100 CopyStatusToResult: migrating ===============================770-- add_column(:builds, :result, :integer)771 -> 0.0007s772-- add_column(:jobs, :result, :integer)773 -> 0.0005s774-- add_column(:repositories, :last_build_result, :integer)775 -> 0.0005s776Executing: UPDATE builds SET result = status;777Executing: UPDATE jobs SET result = status;778Executing: UPDATE repositories SET last_build_result = last_build_status;779== 20120505165100 CopyStatusToResult: migrated (0.0034s) ======================781== 20120511171900 RequestsAddIndexOnHeadCommit: migrating =====================782-- add_index(:requests, :head_commit)783 -> 0.0009s784== 20120511171900 RequestsAddIndexOnHeadCommit: migrated (0.0010s) ============786== 20120521174400 CreatePermissions: migrating ================================787-- create_table(:permissions, {:id=>:integer})788 -> 0.0022s789-- add_index(:permissions, :user_id)790 -> 0.0034s791-- add_index(:permissions, :repository_id)792 -> 0.0007s793== 20120521174400 CreatePermissions: migrated (0.0064s) =======================795== 20120527235800 BuildsAddPreviousResult: migrating ==========================796-- change_table(:builds)797 -> 0.0008s798== 20120527235800 BuildsAddPreviousResult: migrated (0.0008s) =================800== 20120702111126 CreateSubscriptions: migrating ==============================801-- create_table(:subscriptions, {:id=>:integer})802 -> 0.0052s803== 20120702111126 CreateSubscriptions: migrated (0.0053s) =====================805== 20120703114226 AddBillingEmailCreditCardDataToSubscriptions: migrating =====806-- change_table(:subscriptions)807 -> 0.0043s808== 20120703114226 AddBillingEmailCreditCardDataToSubscriptions: migrated (0.0044s)810== 20120713140816 AddSyncInfoToUser: migrating ================================811-- add_column(:users, :in_sync, :boolean)812 -> 0.0019s813-- add_column(:users, :synced_at, :timestamp)814 -> 0.0008s815== 20120713140816 AddSyncInfoToUser: migrated (0.0029s) =======================817== 20120713153215 RenameInSyncToIsSyncing: migrating ==========================818-- rename_column(:users, :in_sync, :is_syncing)819 -> 0.0056s820== 20120713153215 RenameInSyncToIsSyncing: migrated (0.0056s) =================822== 20120725005300 AddQueueToWorkers: migrating ================================823-- add_column(:workers, :queue, :string)824 -> 0.0018s825== 20120725005300 AddQueueToWorkers: migrated (0.0019s) =======================827== 20120727151900 AddJobsIndexOnStateOwnerTypeOwnerId: migrating ==============828-- add_index(:jobs, ["state", "owner_id", "owner_type"], {:name=>"index_jobs_on_state_owner_type_owner_id"})829 -> 0.0022s830== 20120727151900 AddJobsIndexOnStateOwnerTypeOwnerId: migrated (0.0023s) =====832== 20120731005301 AddQueuedAtToJobs: migrating ================================833-- add_column(:jobs, :queued_at, :timestamp, {:precision=>nil})834 -> 0.0018s835== 20120731005301 AddQueuedAtToJobs: migrated (0.0019s) =======================837== 20120731074000 AddAmountToPlans: migrating =================================838-- change_table(:plans)839 -> 0.0016s840== 20120731074000 AddAmountToPlans: migrated (0.0017s) ========================842== 20120802001001 AddPushAndPullToPermissions: migrating ======================843-- add_column(:permissions, :push, :boolean, {:default=>false})844 -> 0.0038s845-- add_column(:permissions, :pull, :boolean, {:default=>false})846 -> 0.0026s847-- change_column_default(:permissions, :admin, false)848 -> 0.0049s849== 20120802001001 AddPushAndPullToPermissions: migrated (0.0114s) =============851== 20120803164000 CreateInvoices: migrating ===================================852-- create_table(:invoices, {:id=>:integer})853 -> 0.0043s854== 20120803164000 CreateInvoices: migrated (0.0043s) ==========================856== 20120803182300 AddInvoiceIdToInvoices: migrating ===========================857-- change_table(:invoices)858 -> 0.0016s859== 20120803182300 AddInvoiceIdToInvoices: migrated (0.0016s) ==================861== 20120804122700 AddStripeInvoiceIdToInvoices: migrating =====================862-- change_table(:invoices)863 -> 0.0019s864-- add_index(:invoices, :stripe_id)865 -> 0.0012s866== 20120804122700 AddStripeInvoiceIdToInvoices: migrated (0.0031s) ============868== 20120806120400 AddPlanToSubscriptions: migrating ===========================869-- change_table(:subscriptions)870 -> 0.0020s871== 20120806120400 AddPlanToSubscriptions: migrated (0.0020s) ==================873== 20120820164000 RenamePlanOnSubscriptions: migrating ========================874-- change_table(:subscriptions)875 -> 0.0032s876== 20120820164000 RenamePlanOnSubscriptions: migrated (0.0033s) ===============878== 20120905093300 CreateStripeEvents: migrating ===============================879-- create_table(:stripe_events, {:id=>:integer})880 -> 0.0029s881-- add_index(:stripe_events, :event_type)882 -> 0.0012s883-- add_index(:stripe_events, :date)884 -> 0.0007s885== 20120905093300 CreateStripeEvents: migrated (0.0051s) ======================887== 20120905171300 AddEventIdToStripeEvents: migrating =========================888-- change_table(:stripe_events)889 -> 0.0009s890-- add_index(:stripe_events, :event_id)891 -> 0.0007s892== 20120905171300 AddEventIdToStripeEvents: migrated (0.0016s) ================894== 20120911160000 AddBuildsIndexOnRepositoryIdAndState: migrating =============895-- remove_index("builds", nil, {:column=>"repository_id", :name=>"index_builds_on_repository_id"})896 -> 0.0023s897-- add_index("builds", ["repository_id", "state"])898 -> 0.0008s899== 20120911160000 AddBuildsIndexOnRepositoryIdAndState: migrated (0.0044s) ====901== 20120911230000 ArtifactsAddAggregatedAt: migrating =========================902-- add_column(:artifacts, :aggregated_at, :timestamp, {:precision=>nil})903 -> 0.0007s904== 20120911230000 ArtifactsAddAggregatedAt: migrated (0.0008s) ================906== 20120911230001 AddArtifactParts: migrating =================================907-- create_table(:artifact_parts, {:id=>:integer})908 -> 0.0029s909-- add_index(:artifact_parts, [:artifact_id, :number])910 -> 0.0007s911== 20120911230001 AddArtifactParts: migrated (0.0037s) ========================913== 20120913143800 AddSubscriptionsCoupon: migrating ===========================914-- change_table(:subscriptions)915 -> 0.0008s916== 20120913143800 AddSubscriptionsCoupon: migrated (0.0008s) ==================918== 20120915012000 BuildsAddIndexOnFinishedAt: migrating =======================919-- add_index("builds", "finished_at")920 -> 0.0009s921== 20120915012000 BuildsAddIndexOnFinishedAt: migrated (0.0009s) ==============923== 20120915012001 CommitsAddIndexOnBranch: migrating ==========================924-- add_index("commits", "branch")925 -> 0.0009s926== 20120915012001 CommitsAddIndexOnBranch: migrated (0.0009s) =================928== 20120915150000 JobsAddIndexOnCreatedAt: migrating ==========================929-- add_index("jobs", "created_at")930 -> 0.0009s931== 20120915150000 JobsAddIndexOnCreatedAt: migrated (0.0010s) =================933== 20121015002500 CreateEvents: migrating =====================================934-- create_table(:events, {:id=>:integer})935 -> 0.0029s936== 20121015002500 CreateEvents: migrated (0.0030s) ============================938== 20121015002501 RequestsAddResultAndMessage: migrating ======================939-- add_column(:requests, :result, :string)940 -> 0.0017s941-- add_column(:requests, :message, :string)942 -> 0.0009s943== 20121015002501 RequestsAddResultAndMessage: migrated (0.0026s) =============945== 20121017040100 CreateBroadcasts: migrating =================================946-- create_table(:broadcasts, {:id=>:integer})947 -> 0.0045s948== 20121017040100 CreateBroadcasts: migrated (0.0046s) ========================950== 20121017040200 EventsChangeDataToText: migrating ===========================951-- change_column(:events, :data, :text)952 -> 0.0018s953== 20121017040200 EventsChangeDataToText: migrated (0.0019s) ==================955== 20121018201301 AddEventTypeToBuilds: migrating =============================956-- add_column(:builds, :event_type, :string)957 -> 0.0017s958== 20121018201301 AddEventTypeToBuilds: migrated (0.0017s) ====================960== 20121018203728 UpdateEventTypeOnBuilds: migrating ==========================961-- execute(" UPDATE builds\n SET event_type = requests.event_type\n FROM requests\n WHERE builds.request_id = requests.id\n")962 -> 0.0021s963== 20121018203728 UpdateEventTypeOnBuilds: migrated (0.0021s) =================965== 20121018210156 AddIndexOnRepositoryIdAndEventTypeToBuilds: migrating =======966-- add_index(:builds, [:repository_id, :event_type])967 -> 0.0021s968== 20121018210156 AddIndexOnRepositoryIdAndEventTypeToBuilds: migrated (0.0021s)970== 20121125122700 RepositoriesAddLastBuildState: migrating ====================971-- add_column(:repositories, :last_build_state, :string)972 -> 0.0019s973== 20121125122700 RepositoriesAddLastBuildState: migrated (0.0020s) ===========975== 20121125122701 BuildsAddPreviousState: migrating ===========================976-- add_column(:builds, :previous_state, :string)977 -> 0.0018s978== 20121125122701 BuildsAddPreviousState: migrated (0.0018s) ==================980== 20121222125200 ArtifactPartsAddFinal: migrating ============================981-- add_column(:artifact_parts, :final, :boolean)982 -> 0.0017s983-- add_column(:artifact_parts, :created_at, :timestamp)984 -> 0.0009s985== 20121222125200 ArtifactPartsAddFinal: migrated (0.0027s) ===================987== 20121222125300 ArtifactPartsChangeContentToText: migrating =================988-- change_column(:artifact_parts, :content, :text)989 -> 0.0016s990== 20121222125300 ArtifactPartsChangeContentToText: migrated (0.0017s) ========992== 20121222140200 ArtifactPartsAddIndexOnArtifactId: migrating ================993-- add_index(:artifact_parts, :artifact_id)994 -> 0.0019s995== 20121222140200 ArtifactPartsAddIndexOnArtifactId: migrated (0.0020s) =======997== 20121223162300 ArtifactPartsRemoveIndexOnArtifactId: migrating =============998-- remove_index(:artifact_parts, :artifact_id, {:name=>"index_artifact_parts_on_artifact_id"})999 -> 0.0040s1000== 20121223162300 ArtifactPartsRemoveIndexOnArtifactId: migrated (0.0065s) ====1002== 20130107165057 AddGithubScopesToUser: migrating ============================1003-- add_column(:users, :github_scopes, :text)1004 -> 0.0019s1005== 20130107165057 AddGithubScopesToUser: migrated (0.0019s) ===================1007== 20130115125836 AddIndexOnLastSeenAtToWorkers: migrating ====================1008-- add_index(:workers, :last_seen_at)1009 -> 0.0023s1010== 20130115125836 AddIndexOnLastSeenAtToWorkers: migrated (0.0023s) ===========1012== 20130115145728 CacheFullNameInWorkers: migrating ===========================1013-- add_column(:workers, :full_name, :string)1014 -> 0.0021s1015-- add_index(:workers, :full_name)1016 -> 0.0012s1017== 20130115145728 CacheFullNameInWorkers: migrated (0.0034s) ==================1019== 20130125002600 ArtifactsAddArchivedAt: migrating ===========================1020-- add_column(:artifacts, :archived_at, :timestamp, {:precision=>nil})1021 -> 0.0022s1022-- add_index(:artifacts, :archived_at)1023 -> 0.0011s1024== 20130125002600 ArtifactsAddArchivedAt: migrated (0.0034s) ==================1026== 20130125171100 ArtifactsAddArchivingAndVerified: migrating =================1027-- add_column(:artifacts, :archiving, :boolean)1028 -> 0.0019s1029-- add_column(:artifacts, :archive_verified, :boolean)1030 -> 0.0009s1031-- add_index(:artifacts, :archiving)1032 -> 0.0011s1033-- add_index(:artifacts, :archive_verified)1034 -> 0.0011s1035== 20130125171100 ArtifactsAddArchivingAndVerified: migrated (0.0051s) ========1037== 20130129142703 CreateEmails: migrating =====================================1038-- create_table(:emails, {:id=>:integer})1039 -> 0.0045s1040-- add_index(:emails, :user_id)1041 -> 0.0011s1042-- add_index(:emails, :email)1043 -> 0.0011s1044== 20130129142703 CreateEmails: migrated (0.0068s) ============================1046== 20130208135800 RenameArtifacts: migrating ==================================1047-- rename_table(:artifacts, :artifacts_backup)1048 -> 0.0131s1049-- rename_table(:artifact_parts, :artifact_parts_backup)1050 -> 0.0112s1051== 20130208135800 RenameArtifacts: migrated (0.0244s) =========================1053== 20130208135801 DropArtifacts: migrating ====================================1054-- drop_table(:artifacts_backup)1055 -> 0.0019s1056-- drop_table(:artifact_parts_backup)1057 -> 0.0027s1058== 20130208135801 DropArtifacts: migrated (0.0047s) ===========================1060== 20130306154311 CreatePgcryptoExtension: migrating ==========================1061-- execute("create extension if not exists pgcrypto")1062 -> 0.0199s1063== 20130306154311 CreatePgcryptoExtension: migrated (0.0199s) =================1065== 20130311211101 AddPullRequestTitleToBuilds: migrating ======================1066-- add_column(:builds, :pull_request_title, :text)1067 -> 0.0016s1068== 20130311211101 AddPullRequestTitleToBuilds: migrated (0.0017s) =============1070== 20130327100801 AddPullRequestNumberToBuilds: migrating =====================1071-- add_column(:builds, :pull_request_number, :integer)1072 -> 0.0009s1073== 20130327100801 AddPullRequestNumberToBuilds: migrated (0.0009s) ============1075== 20130418101437 AddIndexToBuildsRequestId: migrating ========================1076-- execute("CREATE INDEX CONCURRENTLY index_builds_on_request_id ON builds(request_id)")1077 -> 0.0011s1078== 20130418101437 AddIndexToBuildsRequestId: migrated (0.0012s) ===============1080== 20130418103306 AddIndexToJobsOnOwnerIdOwnerTypeAndState: migrating =========1081-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_owner_id_and_owner_type_and_state ON jobs(owner_id, owner_type, state)")1082 -> 0.0010s1083== 20130418103306 AddIndexToJobsOnOwnerIdOwnerTypeAndState: migrated (0.0010s)1085== 20130505023259 AddMoreIndexesToBuilds: migrating ===========================1086-- execute(" CREATE INDEX CONCURRENTLY index_builds_on_repository_id_and_event_type_and_state_and_branch\n ON builds(repository_id, event_type, state, branch);\n")1087 -> 0.0010s1088== 20130505023259 AddMoreIndexesToBuilds: migrated (0.0011s) ==================1090== 20130521115725 AddIndexOnBuildState: migrating =============================1091-- execute(" CREATE INDEX CONCURRENTLY index_builds_on_state\n ON builds(state);\n")1092 -> 0.0009s1093== 20130521115725 AddIndexOnBuildState: migrated (0.0010s) ====================1095== 20130521133050 UpdateFinishedJobs: migrating ===============================1096-- execute("UPDATE jobs SET state = 'passed' WHERE state = 'finished' AND result = 0 AND type = 'Job::Test'")1097 -> 0.0009s1098-- execute("UPDATE jobs SET state = 'failed' WHERE state = 'finished' AND result = 1 AND type = 'Job::Test'")1099 -> 0.0004s1100-- execute("UPDATE jobs SET state = 'errored' WHERE state = 'finished' AND result IS NULL AND type = 'Job::Test'")1101 -> 0.0004s1102-- execute("SELECT COUNT(*) FROM jobs WHERE state = 'finished' AND type = 'Job::Test'")1103 -> 0.0004s1104== 20130521133050 UpdateFinishedJobs: migrated (0.0024s) ======================1106== 20130521134224 UpdateFinishedBuilds: migrating =============================1107-- execute("UPDATE builds SET state = 'passed' WHERE state = 'finished' AND result = 0")1108 -> 0.0009s1109-- execute("UPDATE builds SET state = 'failed' WHERE state = 'finished' AND result = 1")1110 -> 0.0004s1111-- execute("UPDATE builds SET state = 'errored' WHERE state = 'finished' AND result IS NULL")1112 -> 0.0004s1113-- execute("SELECT COUNT(*) FROM builds WHERE state = 'finished'")1114 -> 0.0004s1115== 20130521134224 UpdateFinishedBuilds: migrated (0.0023s) ====================1117== 20130521134800 RemoveUnusedBuildColumns: migrating =========================1118-- remove_column(:builds, :result)1119 -> 0.0007s1120-- remove_column(:builds, :status)1121 -> 0.0004s1122-- remove_column(:builds, :previous_result)1123 -> 0.0004s1124-- remove_column(:builds, :agent)1125 -> 0.0004s1126-- remove_column(:builds, :language)1127 -> 0.0004s1128-- remove_column(:builds, :archived_at)1129 -> 0.0004s1130== 20130521134800 RemoveUnusedBuildColumns: migrated (0.0030s) ================1132== 20130521141357 RemoveUnusedJobColumns: migrating ===========================1133-- remove_column(:jobs, :status)1134 -> 0.0007s1135-- remove_column(:jobs, :job_id)1136 -> 0.0004s1137-- remove_column(:jobs, :retries)1138 -> 0.0005s1139== 20130521141357 RemoveUnusedJobColumns: migrated (0.0016s) ==================1141== 20130618084205 AddCoupons: migrating =======================================1142-- create_table(:coupons, {:id=>:integer})1143 -> 0.0032s1144== 20130618084205 AddCoupons: migrated (0.0033s) ==============================1146== 20130629122945 AddGithubIdToUsers: migrating ===============================1147-- add_column(:repositories, :github_id, :integer)1148 -> 0.0008s1149-- add_index(:repositories, :github_id)1150 -> 0.0007s1151== 20130629122945 AddGithubIdToUsers: migrated (0.0016s) ======================1153== 20130629133531 AddDefaultBranchToRepositories: migrating ===================1154-- add_column(:repositories, :default_branch, :string)1155 -> 0.0008s1156== 20130629133531 AddDefaultBranchToRepositories: migrated (0.0008s) ==========1158== 20130629174449 AddGithubLanguageToRepositories: migrating ==================1159-- add_column(:repositories, :github_language, :string)1160 -> 0.0007s1161== 20130629174449 AddGithubLanguageToRepositories: migrated (0.0008s) =========1163== 20130701175200 AddContactIdToSubscriptions: migrating ======================1164-- change_table(:subscriptions)1165 -> 0.0008s1166== 20130701175200 AddContactIdToSubscriptions: migrated (0.0009s) =============1168== 20130702123456 RemoveUnusedRepositoryColumns: migrating ====================1169-- remove_column(:repositories, :last_duration)1170 -> 0.0007s1171-- remove_column(:repositories, :last_build_status)1172 -> 0.0005s1173-- remove_column(:repositories, :last_build_result)1174 -> 0.0004s1175-- remove_column(:repositories, :last_build_language)1176 -> 0.0004s1177== 20130702123456 RemoveUnusedRepositoryColumns: migrated (0.0021s) ===========1179== 20130702144325 AddUniqueIndexOnUsersGithubIdAndRemoveUniqueIndexOnUsersLogin: migrating1180-- execute("DROP INDEX index_users_on_login")1181 -> 0.0006s1182-- execute("CREATE INDEX CONCURRENTLY index_users_on_login ON users(login)")1183 -> 0.0008s1184-- execute("DROP INDEX index_users_on_github_id")1185 -> 0.0006s1186-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_users_on_github_id ON users(github_id)")1187 -> 0.0009s1188== 20130702144325 AddUniqueIndexOnUsersGithubIdAndRemoveUniqueIndexOnUsersLogin: migrated (0.0031s)1190== 20130705123456 AddExtraColumnsToOrganizations: migrating ===================1191-- add_column(:organizations, :avatar_url, :string)1192 -> 0.0008s1193-- add_column(:organizations, :location, :string)1194 -> 0.0004s1195-- add_column(:organizations, :email, :string)1196 -> 0.0004s1197-- add_column(:organizations, :company, :string)1198 -> 0.0005s1199-- add_column(:organizations, :homepage, :string)1200 -> 0.0005s1201== 20130705123456 AddExtraColumnsToOrganizations: migrated (0.0028s) ==========1203== 20130707164854 AddIndexOnGithubIdToOrganizations: migrating ================1204-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_organizations_on_github_id ON organizations(github_id)")1205 -> 0.0008s1206== 20130707164854 AddIndexOnGithubIdToOrganizations: migrated (0.0008s) =======1208== 20130709185200 CreateAnnotations: migrating ================================1209-- create_table(:annotations, {:id=>:integer})1210 -> 0.0031s1211== 20130709185200 CreateAnnotations: migrated (0.0032s) =======================1213== 20130709233500 CreateAnnotationProviders: migrating ========================1214-- create_table(:annotation_providers, {:id=>:integer})1215 -> 0.0030s1216== 20130709233500 CreateAnnotationProviders: migrated (0.0030s) ===============1218== 20130710000745 AddAnnotationProviderIdToAnnotations: migrating =============1219-- add_column(:annotations, :annotation_provider_id, :integer, {:null=>false})1220 -> 0.0008s1221== 20130710000745 AddAnnotationProviderIdToAnnotations: migrated (0.0009s) ====1223== 20130726101124 AddCanceledAtToJobsAndBuilds: migrating =====================1224-- add_column(:builds, :canceled_at, :timestamp, {:precision=>nil})1225 -> 0.0008s1226-- add_column(:jobs, :canceled_at, :timestamp, {:precision=>nil})1227 -> 0.0005s1228== 20130726101124 AddCanceledAtToJobsAndBuilds: migrated (0.0014s) ============1230== 20130901183019 AddIndexOnRepositoryGithubId: migrating =====================1231-- execute("DROP INDEX index_repositories_on_github_id")1232 -> 0.0007s1233-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_github_id ON repositories(github_id)")1234 -> 0.0009s1235== 20130901183019 AddIndexOnRepositoryGithubId: migrated (0.0016s) ============1237== 20130909203321 AddCachedMatrixIdsToBuilds: migrating =======================1238-- execute("ALTER TABLE builds ADD COLUMN cached_matrix_ids integer[]")1239 -> 0.0007s1240== 20130909203321 AddCachedMatrixIdsToBuilds: migrated (0.0007s) ==============1242== 20130910184823 CreateIndexOnBuildsIdDescAndRepositoryIdAndEventType: migrating1243-- execute("CREATE INDEX CONCURRENTLY index_builds_on_id_repository_id_and_event_type_desc ON builds (id DESC, repository_id, event_type);")1244 -> 0.0010s1245== 20130910184823 CreateIndexOnBuildsIdDescAndRepositoryIdAndEventType: migrated (0.0011s)1247== 20130916101056 AddUniqueIndexOnRepositoryGithubId: migrating ===============1248-- execute("DROP INDEX index_repositories_on_github_id")1249 -> 0.0006s1250-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_repositories_on_github_id ON repositories(github_id)")1251 -> 0.0008s1252== 20130916101056 AddUniqueIndexOnRepositoryGithubId: migrated (0.0015s) ======1254== 20130920135744 AddSettingsToRepositories: migrating ========================1255-- add_column(:repositories, :settings, :json)1256 -> 0.0007s1257== 20130920135744 AddSettingsToRepositories: migrated (0.0008s) ===============1259== 20131104101056 RemoveWorkersTableAndIndexes: migrating =====================1260-- drop_table(:workers)1261 -> 0.0018s1262== 20131104101056 RemoveWorkersTableAndIndexes: migrated (0.0018s) ============1264== 20131109101056 RemoveEventsTable: migrating ================================1265-- drop_table(:events)1266 -> 0.0014s1267== 20131109101056 RemoveEventsTable: migrated (0.0014s) =======================1269== 20140120225125 RemoveAnnotationImageInfo: migrating ========================1270-- remove_column(:annotations, :image_url)1271 -> 0.0007s1272-- remove_column(:annotations, :image_alt)1273 -> 0.0004s1274== 20140120225125 RemoveAnnotationImageInfo: migrated (0.0012s) ===============1276== 20140121003026 AddStatusToAnnotations: migrating ===========================1277-- add_column(:annotations, :status, :string)1278 -> 0.0008s1279== 20140121003026 AddStatusToAnnotations: migrated (0.0009s) ==================1281== 20140204220926 AddIndicesToRequests: migrating =============================1282-- execute("CREATE INDEX CONCURRENTLY index_requests_on_repository_id ON requests(repository_id)")1283 -> 0.0033s1284-- execute("CREATE INDEX CONCURRENTLY index_requests_on_commit_id ON requests(commit_id)")1285 -> 0.0008s1286== 20140204220926 AddIndicesToRequests: migrated (0.0042s) ====================1288== 20140210003014 AddIndicesToMemberships: migrating ==========================1289-- execute("CREATE INDEX CONCURRENTLY index_memberships_on_user_id ON memberships(user_id)")1290 -> 0.0008s1291== 20140210003014 AddIndicesToMemberships: migrated (0.0008s) =================1293== 20140210012509 RemoveUnusedIndices: migrating ==============================1294-- execute("DROP INDEX CONCURRENTLY index_commits_on_commit")1295 -> 0.0008s1296-- execute("DROP INDEX CONCURRENTLY index_builds_on_state")1297 -> 0.0007s1298-- execute("DROP INDEX CONCURRENTLY index_commits_on_branch")1299 -> 0.0006s1300-- execute("DROP INDEX CONCURRENTLY index_users_on_github_oauth_token")1301 -> 0.0006s1302-- execute("DROP INDEX CONCURRENTLY index_builds_on_finished_at")1303 -> 0.0007s1304-- execute("DROP INDEX CONCURRENTLY index_jobs_on_queue_and_state")1305 -> 0.0007s1306-- execute("DROP INDEX CONCURRENTLY index_jobs_on_created_at")1307 -> 0.0006s1308== 20140210012509 RemoveUnusedIndices: migrated (0.0048s) =====================1310== 20140612131826 AddRemovedInfoToLogs: migrating =============================1311== 20140612131826 AddRemovedInfoToLogs: migrated (0.0008s) ====================1313== 20140827121945 AddEducationFieldToUser: migrating ==========================1314-- add_column(:users, :education, :boolean)1315 -> 0.0028s1316== 20140827121945 AddEducationFieldToUser: migrated (0.0029s) =================1318== 20150121135400 JobsAddReceivedAt: migrating ================================1319-- add_column(:jobs, :received_at, :timestamp, {:precision=>nil})1320 -> 0.0079s1321== 20150121135400 JobsAddReceivedAt: migrated (0.0080s) =======================1323== 20150121135401 BuildsAddReceivedAt: migrating ==============================1324-- add_column(:builds, :received_at, :timestamp, {:precision=>nil})1325 -> 0.0012s1326== 20150121135401 BuildsAddReceivedAt: migrated (0.0013s) =====================1328== 20150204144312 AddIndexOnRepositoryIdToCommits: migrating ==================1329-- execute("DROP INDEX IF EXISTS index_commits_on_repository_id")1330 -> 0.0004s1331-- execute("CREATE INDEX CONCURRENTLY index_commits_on_repository_id ON commits(repository_id)")1332 -> 0.0010s1333== 20150204144312 AddIndexOnRepositoryIdToCommits: migrated (0.0015s) =========1335== 20150210170900 IndexRequestsOnCreatedAt: migrating =========================1336-- execute("DROP INDEX IF EXISTS index_requests_on_created_at")1337 -> 0.0004s1338-- execute("CREATE INDEX CONCURRENTLY index_requests_on_created_at ON requests(created_at)")1339 -> 0.0010s1340== 20150210170900 IndexRequestsOnCreatedAt: migrated (0.0015s) ================1342== 20150223125700 CreateBranches: migrating ===================================1343-- create_table(:branches, {:id=>:integer})1344 -> 0.0043s1345-- add_index(:branches, [:repository_id, :name], {:unique=>true})1346 -> 0.0010s1347== 20150223125700 CreateBranches: migrated (0.0054s) ==========================1349== 20150311020321 AddNextBuildNumberToRepository: migrating ===================1350-- add_column(:repositories, :next_build_number, :integer)1351 -> 0.0012s1352== 20150311020321 AddNextBuildNumberToRepository: migrated (0.0012s) ==========1354== 20150316020321 AddActiveIndexToRepository: migrating =======================1355-- execute("DROP INDEX IF EXISTS index_repositories_on_active")1356 -> 0.0004s1357-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_active ON repositories(active)")1358 -> 0.0010s1359== 20150316020321 AddActiveIndexToRepository: migrated (0.0015s) ==============1361== 20150316080321 AddOwnerTypeAndOwnerIdIndexesToBuilds: migrating ============1362-- execute("DROP INDEX IF EXISTS index_builds_on_owner_type")1363 -> 0.0004s1364-- execute("DROP INDEX IF EXISTS index_builds_on_owner_id")1365 -> 0.0003s1366-- execute("CREATE INDEX CONCURRENTLY index_builds_on_owner_type ON builds(owner_type)")1367 -> 0.0011s1368-- execute("CREATE INDEX CONCURRENTLY index_builds_on_owner_id ON builds(owner_id)")1369 -> 0.0010s1370== 20150316080321 AddOwnerTypeAndOwnerIdIndexesToBuilds: migrated (0.0030s) ===1372== 20150316100321 AddOwnerTypeAndOwnerIdIndexesToRepositories: migrating ======1373-- execute("DROP INDEX IF EXISTS index_repositories_on_owner_type")1374 -> 0.0003s1375-- execute("DROP INDEX IF EXISTS index_repositories_on_owner_id")1376 -> 0.0003s1377-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_owner_type ON repositories(owner_type)")1378 -> 0.0010s1379-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_owner_id ON repositories(owner_id)")1380 -> 0.0010s1381== 20150316100321 AddOwnerTypeAndOwnerIdIndexesToRepositories: migrated (0.0028s)1383== 20150317004600 AddSlugIndexToRepositories: migrating =======================1384-- execute("CREATE EXTENSION IF NOT EXISTS pg_trgm")1385 -> 0.0097s1386-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_slug ON repositories USING gin((owner_name || '/' || name) gin_trgm_ops)")1387 -> 0.0026s1388== 20150317004600 AddSlugIndexToRepositories: migrated (0.0124s) ==============1390== 20150317020321 AddTokenIndexToTokens: migrating ============================1391-- execute("DROP INDEX IF EXISTS index_tokens_on_token")1392 -> 0.0005s1393-- execute("CREATE INDEX CONCURRENTLY index_tokens_on_token ON tokens(token)")1394 -> 0.0012s1395== 20150317020321 AddTokenIndexToTokens: migrated (0.0017s) ===================1397== 20150317080321 AddLoginIndexToOrganizations: migrating =====================1398-- execute("DROP INDEX IF EXISTS index_organizations_on_login")1399 -> 0.0004s1400-- execute("CREATE INDEX CONCURRENTLY index_organizations_on_login ON organizations(login)")1401 -> 0.0011s1402== 20150317080321 AddLoginIndexToOrganizations: migrated (0.0016s) ============1404== 20150414001337 AddLowerCaseIndices: migrating ==============================1405-- execute("DROP INDEX IF EXISTS index_organizations_on_lower_login")1406 -> 0.0005s1407-- execute("CREATE INDEX CONCURRENTLY index_organizations_on_lower_login ON organizations USING btree(lower(login))")1408 -> 0.0013s1409-- execute("DROP INDEX IF EXISTS index_users_on_lower_login")1410 -> 0.0003s1411-- execute("CREATE INDEX CONCURRENTLY index_users_on_lower_login ON users USING btree(lower(login))")1412 -> 0.0012s1413-- execute("DROP INDEX IF EXISTS index_repositories_on_lower_name")1414 -> 0.0004s1415-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_lower_name ON repositories USING btree(lower(name))")1416 -> 0.0013s1417-- execute("DROP INDEX IF EXISTS index_repositories_on_lower_owner_name")1418 -> 0.0003s1419-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_lower_owner_name ON repositories USING btree(lower(owner_name))")1420 -> 0.0012s1421== 20150414001337 AddLowerCaseIndices: migrated (0.0069s) =====================1423== 20150528101600 RepositoriesAddIndexOwnerName: migrating ====================1424-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_owner_name ON repositories(owner_name)")1425 -> 0.0011s1426== 20150528101600 RepositoriesAddIndexOwnerName: migrated (0.0011s) ===========1428== 20150528101601 RepositoriesAddIndexName: migrating =========================1429-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_name ON repositories(name)")1430 -> 0.0012s1431== 20150528101601 RepositoriesAddIndexName: migrated (0.0012s) ================1433== 20150528101602 RepositoriesDropIndexOwnerNameName: migrating ===============1434-- execute("DROP INDEX CONCURRENTLY index_repositories_on_owner_name_and_name")1435 -> 0.0011s1436== 20150528101602 RepositoriesDropIndexOwnerNameName: migrated (0.0011s) ======1438== 20150528101603 BuildsAddIndexEventType: migrating ==========================1439-- execute("CREATE INDEX CONCURRENTLY index_builds_on_event_type ON builds (event_type)")1440 -> 0.0012s1441== 20150528101603 BuildsAddIndexEventType: migrated (0.0013s) =================1443== 20150528101604 BuildsAddIndexRepositoryId: migrating =======================1444-- execute("CREATE INDEX CONCURRENTLY index_builds_on_repository_id ON builds (repository_id)")1445 -> 0.0012s1446== 20150528101604 BuildsAddIndexRepositoryId: migrated (0.0012s) ==============1448== 20150528101605 BuildsAddIndexState: migrating ==============================1449-- execute("CREATE INDEX CONCURRENTLY index_builds_on_state ON builds (state)")1450 -> 0.0012s1451== 20150528101605 BuildsAddIndexState: migrated (0.0012s) =====================1453== 20150528101607 BuildsAddIndexBranch: migrating =============================1454-- execute("CREATE INDEX CONCURRENTLY index_builds_on_branch ON builds (branch)")1455 -> 0.0012s1456== 20150528101607 BuildsAddIndexBranch: migrated (0.0012s) ====================1458== 20150528101608 BuildsDropIndexRepositoryIdAndState: migrating ==============1459-- execute("DROP INDEX CONCURRENTLY index_builds_on_repository_id_and_state")1460 -> 0.0011s1461== 20150528101608 BuildsDropIndexRepositoryIdAndState: migrated (0.0011s) =====1463== 20150528101609 BuildsDropIndexRepositoryIdAndEventType: migrating ==========1464-- execute("DROP INDEX CONCURRENTLY index_builds_on_repository_id_and_event_type")1465 -> 0.0011s1466== 20150528101609 BuildsDropIndexRepositoryIdAndEventType: migrated (0.0012s) =1468== 20150528101610 BuildsDropIndexIdRepositoryIdAndEventTypeDesc: migrating ====1469-- execute("DROP INDEX CONCURRENTLY index_builds_on_id_repository_id_and_event_type_desc")1470 -> 0.0010s1471== 20150528101610 BuildsDropIndexIdRepositoryIdAndEventTypeDesc: migrated (0.0010s)1473== 20150528101611 BuildsDropIndexRepositoryIdAndEventTypeAndStateAndBranch: migrating1474-- execute("DROP INDEX CONCURRENTLY index_builds_on_repository_id_and_event_type_and_state_and_bran")1475 -> 0.0010s1476== 20150528101611 BuildsDropIndexRepositoryIdAndEventTypeAndStateAndBranch: migrated (0.0011s)1478== 20150609175200 AddCancelationColumnsToSubscriptions: migrating =============1479-- change_table(:subscriptions)1480 -> 0.0017s1481== 20150609175200 AddCancelationColumnsToSubscriptions: migrated (0.0019s) ====1483== 20150610143500 JobsAddIndexOwnerId: migrating ==============================1484-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_owner_id ON jobs (owner_id)")1485 -> 0.0013s1486== 20150610143500 JobsAddIndexOwnerId: migrated (0.0013s) =====================1488== 20150610143501 JobsAddIndexOwnerType: migrating ============================1489-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_owner_type ON jobs (owner_type)")1490 -> 0.0012s1491== 20150610143501 JobsAddIndexOwnerType: migrated (0.0012s) ===================1493== 20150610143502 JobsAddIndexSourceId: migrating =============================1494-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_source_id ON jobs (source_id)")1495 -> 0.0011s1496== 20150610143502 JobsAddIndexSourceId: migrated (0.0012s) ====================1498== 20150610143503 JobsAddIndexSourceType: migrating ===========================1499-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_source_type ON jobs (source_type)")1500 -> 0.0011s1501== 20150610143503 JobsAddIndexSourceType: migrated (0.0013s) ==================1503== 20150610143504 JobsAddIndexType: migrating =================================1504-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_type ON jobs (type)")1505 -> 0.0013s1506== 20150610143504 JobsAddIndexType: migrated (0.0013s) ========================1508== 20150610143505 JobsDropIndexOwnerIdAndOwnerTypeAndState: migrating =========1509-- execute("DROP INDEX CONCURRENTLY index_jobs_on_owner_id_and_owner_type_and_state")1510 -> 0.0015s1511== 20150610143505 JobsDropIndexOwnerIdAndOwnerTypeAndState: migrated (0.0015s)1513== 20150610143506 JobsDropIndexStateOwnerTypeOwnerId: migrating ===============1514-- execute("DROP INDEX CONCURRENTLY index_jobs_on_state_owner_type_owner_id")1515 -> 0.0010s1516== 20150610143506 JobsDropIndexStateOwnerTypeOwnerId: migrated (0.0011s) ======1518== 20150610143507 JobsDropIndexTypeAndSourceIdAndSourceType: migrating ========1519-- index_exists?(:jobs, :index_jobs_on_type_and_owner_id_and_owner_type, {:name=>"index_jobs_on_index_jobs_on_type_and_owner_id_and_owner_type"})1520 -> 0.0072s1521== 20150610143507 JobsDropIndexTypeAndSourceIdAndSourceType: migrated (0.0073s)1523== 20150610143508 JobsAddIndexState: migrating ================================1524-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_state ON jobs (state)")1525 -> 0.0012s1526== 20150610143508 JobsAddIndexState: migrated (0.0013s) =======================1528== 20150610143509 JobsAddIndexQueue: migrating ================================1529-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_queue ON jobs (queue)")1530 -> 0.0011s1531== 20150610143509 JobsAddIndexQueue: migrated (0.0012s) =======================1533== 20150610143510 TokensAddIndexUserId: migrating =============================1534-- execute("CREATE INDEX CONCURRENTLY index_tokens_on_user_id ON tokens (user_id)")1535 -> 0.0010s1536== 20150610143510 TokensAddIndexUserId: migrated (0.0011s) ====================1538== 20150615103059 AddStatusToSubscriptions: migrating =========================1539-- add_column(:subscriptions, :status, :string)1540 -> 0.0011s1541== 20150615103059 AddStatusToSubscriptions: migrated (0.0011s) ================1543== 20150629231300 ReposAddInvalidatedAt: migrating ============================1544-- add_column(:repositories, :invalidated_at, :timestamp, {:precision=>nil})1545 -> 0.0023s1546== 20150629231300 ReposAddInvalidatedAt: migrated (0.0024s) ===================1548== 20150923131400 BroadcastsAddCategory: migrating ============================1549-- add_column(:broadcasts, :category, :string)1550 -> 0.0010s1551== 20150923131400 BroadcastsAddCategory: migrated (0.0011s) ===================1553== 20151112153500 CreateStars: migrating ======================================1554-- create_table(:stars, {:id=>:integer})1555 -> 0.0034s1556-- add_index(:stars, :user_id)1557 -> 0.0009s1558== 20151112153500 CreateStars: migrated (0.0044s) =============================1560== 20151113111400 StarsAddIndexUserIdAndRepositoryId: migrating ===============1561-- execute("CREATE UNIQUE INDEX index_stars_on_user_id_and_repository_id ON stars (user_id, repository_id)")1562 -> 0.0009s1563== 20151113111400 StarsAddIndexUserIdAndRepositoryId: migrated (0.0010s) ======1565== 20151127153500 UsersAddIndexGithubOauthToken: migrating ====================1566-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_users_on_github_oauth_token ON users (github_oauth_token)")1567 -> 0.0012s1568== 20151127153500 UsersAddIndexGithubOauthToken: migrated (0.0012s) ===========1570== 20151127154200 AnnotationsAddIndexJobId: migrating =========================1571-- execute("CREATE INDEX CONCURRENTLY index_annotations_on_job_id ON annotations (job_id)")1572 -> 0.0012s1573== 20151127154200 AnnotationsAddIndexJobId: migrated (0.0013s) ================1575== 20151127154600 BroadcastsAddIndexRecipientIdAndRecipientType: migrating ====1576-- execute("CREATE INDEX CONCURRENTLY index_broadcasts_on_recipient_id_and_recipient_type ON broadcasts (recipient_id, recipient_type)")1577 -> 0.0012s1578== 20151127154600 BroadcastsAddIndexRecipientIdAndRecipientType: migrated (0.0013s)1580== 20151202122200 UsersAddFirstLoggedInAt: migrating ==========================1581-- add_column(:users, :first_logged_in_at, :timestamp, {:precision=>nil})1582 -> 0.0011s1583== 20151202122200 UsersAddFirstLoggedInAt: migrated (0.0011s) =================1585== 20160107120927 AddCronTable: migrating =====================================1586-- create_table(:crons, {:id=>:integer})1587 -> 0.0049s1588== 20160107120927 AddCronTable: migrated (0.0050s) ============================1590== 20160303165750 AddDebugOptionsToJobs: migrating ============================1591-- add_column(:jobs, :debug_options, :text)1592 -> 0.0011s1593== 20160303165750 AddDebugOptionsToJobs: migrated (0.0011s) ===================1595== 20160412113020 BuildsDropIndexOwnerType: migrating =========================1596-- execute("DROP INDEX CONCURRENTLY index_builds_on_owner_type")1597 -> 0.0011s1598== 20160412113020 BuildsDropIndexOwnerType: migrated (0.0011s) ================1600== 20160412113070 RepositoriesDropIndexLastBuildStartedAt: migrating ==========1601-- execute("DROP INDEX CONCURRENTLY index_repositories_on_last_build_started_at")1602 -> 0.0012s1603== 20160412113070 RepositoriesDropIndexLastBuildStartedAt: migrated (0.0012s) =1605== 20160412121405 JobsDropIndexType: migrating ================================1606-- execute("DROP INDEX CONCURRENTLY index_jobs_on_type")1607 -> 0.0010s1608== 20160412121405 JobsDropIndexType: migrated (0.0010s) =======================1610== 20160412123900 JobsDropIndexSourceType: migrating ==========================1611-- execute("DROP INDEX CONCURRENTLY index_jobs_on_source_type")1612 -> 0.0010s1613== 20160412123900 JobsDropIndexSourceType: migrated (0.0011s) =================1615== 20160414214442 JobsAddIndexQueuedAt: migrating =============================1616-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_queued_at ON jobs (queued_at)")1617 -> 0.0013s1618== 20160414214442 JobsAddIndexQueuedAt: migrated (0.0013s) ====================1620== 20160422104300 BuildsAddIndexNumber: migrating =============================1621-- execute("CREATE INDEX CONCURRENTLY index_builds_on_number ON builds (number)")1622 -> 0.0012s1623== 20160422104300 BuildsAddIndexNumber: migrated (0.0013s) ====================1625== 20160422121400 BuildsAddIndexRepositoryIdAndNumberAndEventType: migrating ==1626-- execute("CREATE INDEX CONCURRENTLY index_builds_on_repository_id_and_number_and_event_type ON builds (repository_id, number, event_type)")1627 -> 0.0014s1628== 20160422121400 BuildsAddIndexRepositoryIdAndNumberAndEventType: migrated (0.0014s)1630== 20160510142700 JobsAddIndexCreatedAt: migrating ============================1631-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_created_at ON jobs (created_at)")1632 -> 0.0012s1633== 20160510142700 JobsAddIndexCreatedAt: migrated (0.0012s) ===================1635== 20160510144200 BuildsAddPrivate: migrating =================================1636-- change_table(:builds)1637 -> 0.0012s1638== 20160510144200 BuildsAddPrivate: migrated (0.0012s) ========================1640== 20160510150300 JobsAddPrivate: migrating ===================================1641-- change_table(:jobs)1642 -> 0.0011s1643== 20160510150300 JobsAddPrivate: migrated (0.0012s) ==========================1645== 20160510150400 RequestsAddPrivate: migrating ===============================1646-- change_table(:requests)1647 -> 0.0009s1648== 20160510150400 RequestsAddPrivate: migrated (0.0010s) ======================1650== 20160513074300 AddCurrentBuildIdToRepositories: migrating ==================1651-- add_column(:repositories, :current_build_id, :bigint)1652 -> 0.0010s1653-- execute("ALTER TABLE repositories ADD CONSTRAINT fk_repositories_current_build_id FOREIGN KEY (current_build_id) REFERENCES builds (id);")1654 -> 0.0029s1655== 20160513074300 AddCurrentBuildIdToRepositories: migrated (0.0039s) =========1657== 20160609163600 PermissionsAddIndexUserIdAndRepositoryId: migrating =========1658-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_permissions_on_user_id_and_repository_id ON permissions (user_id, repository_id)")1659 -> 0.0013s1660== 20160609163600 PermissionsAddIndexUserIdAndRepositoryId: migrated (0.0013s)1662== 20160623133900 CreatePreviousJobStates: migrating ==========================1663-- create_table(:previous_job_states, {:id=>:integer})1664 -> 0.0042s1665-- add_column(:jobs, :previous_job_state_id, :bigint)1666 -> 0.0010s1667== 20160623133900 CreatePreviousJobStates: migrated (0.0054s) =================1669== 20160623133901 AddPreviousStatesTriggers: migrating ========================1670-- execute(" CREATE FUNCTION save_state_change() RETURNS trigger AS $$\n DECLARE\n previous_job_state_id BIGINT;\n BEGIN\n if TG_OP='UPDATE' then\n UPDATE previous_job_states SET ended_at = NOW() WHERE id = OLD.previous_job_state_id;\n end if;\n\n INSERT INTO previous_job_states (job_id, set_at, state) VALUES(NEW.id, NOW(), NEW.state)\n RETURNING id INTO previous_job_state_id;\n NEW.previous_job_state_id = previous_job_state_id;\n\n RETURN NEW;\n END;\n $$ LANGUAGE plpgsql;\n\n CREATE TRIGGER save_state_change_on_update\n BEFORE UPDATE on jobs\n FOR EACH ROW\n WHEN (OLD.state IS DISTINCT FROM NEW.state)\n EXECUTE PROCEDURE save_state_change();\n\n CREATE TRIGGER save_state_change_on_insert\n BEFORE INSERT on jobs\n FOR EACH ROW\n EXECUTE PROCEDURE save_state_change();\n")1671 -> 0.0038s1672== 20160623133901 AddPreviousStatesTriggers: migrated (0.0039s) ===============1674== 20160712125400 RevertPreviousJobStates: migrating ==========================1675-- execute(" DROP TRIGGER IF EXISTS save_state_change_on_update on jobs;\n DROP TRIGGER IF EXISTS save_state_change_on_insert on jobs;\n DROP FUNCTION IF EXISTS save_state_change();\n")1676 -> 0.0015s1677-- remove_column(:jobs, :previous_job_state_id)1678 -> 0.0006s1679-- drop_table(:previous_job_states)1680 -> 0.0019s1681== 20160712125400 RevertPreviousJobStates: migrated (0.0042s) =================1683== 20160819103700 AddAvatarUrlToUsers: migrating ==============================1684-- add_column(:users, :avatar_url, :string)1685 -> 0.0014s1686== 20160819103700 AddAvatarUrlToUsers: migrated (0.0015s) =====================1688== 20160920220400 AddRoleToMemberships: migrating =============================1689-- add_column(:memberships, :role, :string)1690 -> 0.0020s1691== 20160920220400 AddRoleToMemberships: migrated (0.0022s) ====================1693== 20161028154600 RemoveTypeIndices: migrating ================================1694-- execute("DROP INDEX CONCURRENTLY IF EXISTS index_requests_on_event_type")1695 -> 0.0004s1696-- execute("DROP INDEX CONCURRENTLY IF EXISTS index_jobs_on_owner_type")1697 -> 0.0012s1698== 20161028154600 RemoveTypeIndices: migrated (0.0019s) =======================1700== 20161101000000 AddNextRunLastRunToCrons: migrating =========================1701-- column_exists?(:crons, :next_run)1702 -> 0.0040s1703-- add_column(:crons, :next_run, :timestamp, {:precision=>nil})1704 -> 0.0011s1705-- column_exists?(:crons, :last_run)1706 -> 0.0037s1707-- add_column(:crons, :last_run, :timestamp, {:precision=>nil})1708 -> 0.0008s1709== 20161101000000 AddNextRunLastRunToCrons: migrated (0.0100s) ================1711== 20161101000001 AddDontRunIfRecentBuildExists: migrating ====================1712-- column_exists?(:crons, :dont_run_if_recent_build_exists)1713 -> 0.0035s1714-- add_column(:crons, :dont_run_if_recent_build_exists, :boolean, {:default=>false})1715 -> 0.0050s1716== 20161101000001 AddDontRunIfRecentBuildExists: migrated (0.0087s) ===========1718== 20161201112200 CreateBetaFeatures: migrating ===============================1719-- create_table(:beta_features, {:id=>:integer})1720 -> 0.0056s1721== 20161201112200 CreateBetaFeatures: migrated (0.0057s) ======================1723== 20161201112600 CreateUserBetaFeatures: migrating ===========================1724-- create_table(:user_beta_features, {:id=>:integer})1725 -> 0.0046s1726-- add_index(:user_beta_features, [:user_id, :beta_feature_id])1727 -> 0.0015s1728== 20161201112600 CreateUserBetaFeatures: migrated (0.0063s) ==================1730== 20161202000000 RemoveDisableByBuildFromCrons: migrating ====================1731-- remove_column(:crons, :disable_by_build)1732 -> 0.0015s1733== 20161202000000 RemoveDisableByBuildFromCrons: migrated (0.0016s) ===========1735== 20161206155800 AddBillingAdminOnlyToOrganizations: migrating ===============1736-- add_column(:organizations, :billing_admin_only, :boolean)1737 -> 0.0013s1738== 20161206155800 AddBillingAdminOnlyToOrganizations: migrated (0.0015s) ======1740== 20161221171300 BuildsAddIndexRepositoryIdAndNumber: migrating ==============1741-- execute("CREATE INDEX CONCURRENTLY index_builds_on_repository_id_and_number ON builds(repository_id, (number::integer))")1742 -> 0.0021s1743== 20161221171300 BuildsAddIndexRepositoryIdAndNumber: migrated (0.0021s) =====1745== 20170211000000 JobsAddStageNumber: migrating ===============================1746-- add_column(:jobs, :stage_number, :string)1747 -> 0.0013s1748== 20170211000000 JobsAddStageNumber: migrated (0.0015s) ======================1750== 20170211000001 JobsAddStageId: migrating ===================================1751-- change_table(:jobs)1752 -> 0.0014s1753== 20170211000001 JobsAddStageId: migrated (0.0015s) ==========================1755== 20170211000002 StagesCreate: migrating =====================================1756-- create_table(:stages, {:id=>:integer})1757 -> 0.0043s1758== 20170211000002 StagesCreate: migrated (0.0044s) ============================1760== 20170211000003 StagesAddStateAndTimestamps: migrating ======================1761-- change_table(:stages)1762 -> 0.0028s1763== 20170211000003 StagesAddStateAndTimestamps: migrated (0.0028s) =============1765== 20170213124000 AddConstraintForOwnerIdToSubscriptions: migrating ===========1766-- execute("CREATE UNIQUE INDEX subscriptions_owner ON subscriptions (owner_id, owner_type) WHERE (status = 'subscribed');")1767 -> 0.0017s1768== 20170213124000 AddConstraintForOwnerIdToSubscriptions: migrated (0.0017s) ==1770== 20170316000000 QueueableJobsCreate: migrating ==============================1771-- create_table(:queueable_jobs, {:id=>:integer})1772 -> 0.0034s1773== 20170316000000 QueueableJobsCreate: migrated (0.0035s) =====================1775== 20170316000001 QueueableJobsIndexJobId: migrating ==========================1776-- add_index(:queueable_jobs, :job_id, {:algorithm=>:concurrently})1777 -> 0.0014s1778== 20170316000001 QueueableJobsIndexJobId: migrated (0.0015s) =================1780== 20170318000000 PullRequestsCreate: migrating ===============================1781-- create_table(:pull_requests, {:id=>:integer})1782 -> 0.0048s1783== 20170318000000 PullRequestsCreate: migrated (0.0050s) ======================1785== 20170318000001 RequestsAddPullRequestId: migrating =========================1786-- change_table(:requests)1787 -> 0.0016s1788== 20170318000001 RequestsAddPullRequestId: migrated (0.0017s) ================1790== 20170318000002 BuildsAddPullRequestId: migrating ===========================1791-- change_table(:builds)1792 -> 0.0013s1793== 20170318000002 BuildsAddPullRequestId: migrated (0.0014s) ==================1795== 20170322000000 AddIndexOnRequestsRepositoryIdAndIdDesc: migrating ==========1796-- execute("CREATE INDEX CONCURRENTLY index_requests_on_repository_id_and_id_desc ON requests (repository_id, id DESC);")1797 -> 0.0013s1798== 20170322000000 AddIndexOnRequestsRepositoryIdAndIdDesc: migrated (0.0014s) =1800== 20170331000000 AddIndexRepositoryIdOnPullRequests: migrating ===============1801-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_pull_requests_on_repository_id_and_number ON pull_requests (repository_id, (number::integer));")1802 -> 0.0012s1803== 20170331000000 AddIndexRepositoryIdOnPullRequests: migrated (0.0013s) ======1805== 20170401000000 OwnerGroupsCreate: migrating ================================1806-- create_table(:owner_groups, {:id=>:integer})1807 -> 0.0044s1808== 20170401000000 OwnerGroupsCreate: migrated (0.0045s) =======================1810== 20170401000001 OwnerGroupsIndexOwnerIdOwnerType: migrating =================1811-- execute("CREATE INDEX CONCURRENTLY index_owner_groups_on_owner_type_and_owner_id ON owner_groups (owner_type, owner_id);")1812 -> 0.0012s1813== 20170401000001 OwnerGroupsIndexOwnerIdOwnerType: migrated (0.0014s) ========1815== 20170401000002 OwnerGroupsIndexUuid: migrating =============================1816-- execute("CREATE INDEX CONCURRENTLY index_owner_groups_on_uuid ON owner_groups (uuid);")1817 -> 0.0012s1818== 20170401000002 OwnerGroupsIndexUuid: migrated (0.0013s) ====================1820== 20170405000000 TagsCreate: migrating =======================================1821-- create_table(:tags, {:id=>:integer})1822 -> 0.0047s1823== 20170405000000 TagsCreate: migrated (0.0047s) ==============================1825== 20170405000001 RequestsAddBranchIdAndTagId: migrating ======================1826-- change_table(:requests)1827 -> 0.0022s1828== 20170405000001 RequestsAddBranchIdAndTagId: migrated (0.0023s) =============1830== 20170405000002 CommitsAddBranchIdAndTagId: migrating =======================1831-- change_table(:commits)1832 -> 0.0022s1833== 20170405000002 CommitsAddBranchIdAndTagId: migrated (0.0022s) ==============1835== 20170405000003 BuildsAddBranchIdAndTagId: migrating ========================1836-- change_table(:builds)1837 -> 0.0021s1838== 20170405000003 BuildsAddBranchIdAndTagId: migrated (0.0023s) ===============1840== 20170408000000 RequestsAddSenderId: migrating ==============================1841-- change_table(:requests)1842 -> 0.0017s1843== 20170408000000 RequestsAddSenderId: migrated (0.0018s) =====================1845== 20170408000001 BuildsAddSenderId: migrating ================================1846-- change_table(:builds)1847 -> 0.0021s1848== 20170408000001 BuildsAddSenderId: migrated (0.0022s) =======================1850== 20170410000000 JobsIndexStageId: migrating =================================1851-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_stage_id ON jobs (stage_id);")1852 -> 0.0017s1853== 20170410000000 JobsIndexStageId: migrated (0.0017s) ========================1855== 20170411000000 TagsIndexRepoIdAndName: migrating ===========================1856-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_tags_on_repository_id_and_name ON tags (repository_id, name);")1857 -> 0.0013s1858== 20170411000000 TagsIndexRepoIdAndName: migrated (0.0014s) ==================1860== 20170419093249 AddSourceToSubscriptions: migrating =========================1861-- execute(" CREATE TYPE source_type AS ENUM ('manual', 'stripe', 'github', 'unknown');\n")1862 -> 0.0023s1863-- add_column(:subscriptions, :source, :source_type, {:default=>"unknown", :null=>false})1864 -> 0.0052s1865== 20170419093249 AddSourceToSubscriptions: migrated (0.0078s) ================1867== 20170531125700 AddIndexOnBuildsSenderTypeAndSenderId: migrating ============1868-- execute("CREATE INDEX CONCURRENTLY index_builds_on_sender_type_and_sender_id ON builds (sender_type, sender_id);")1869 -> 0.0017s1870== 20170531125700 AddIndexOnBuildsSenderTypeAndSenderId: migrated (0.0017s) ===1872== 20170601163700 DropIndexOnRepositoriesBuildsAndCommits: migrating ==========1873-- execute("DROP INDEX CONCURRENTLY index_repositories_on_lower_owner_name")1874 -> 0.0011s1875-- execute("DROP INDEX CONCURRENTLY index_repositories_on_owner_type")1876 -> 0.0011s1877-- execute("DROP INDEX CONCURRENTLY index_commits_on_repository_id")1878 -> 0.0010s1879-- execute("DROP INDEX CONCURRENTLY index_builds_on_number")1880 -> 0.0011s1881== 20170601163700 DropIndexOnRepositoriesBuildsAndCommits: migrated (0.0045s) =1883== 20170601164400 AddIndexOnBuildsAndStages: migrating ========================1884-- execute("CREATE INDEX CONCURRENTLY index_builds_on_repository_id_and_branch_and_event_type_and_id ON builds (repository_id, branch, event_type, id)")1885 -> 0.0017s1886-- execute("CREATE INDEX CONCURRENTLY index_stages_on_build_id ON stages (build_id)")1887 -> 0.0013s1888== 20170601164400 AddIndexOnBuildsAndStages: migrated (0.0031s) ===============1890== 20170609174400 DropUnusedIndexesOnJobsAndBuilds: migrating =================1891-- execute("DROP INDEX CONCURRENTLY index_jobs_on_repository_id")1892 -> 0.0012s1893-- execute("DROP INDEX CONCURRENTLY index_jobs_on_queued_at")1894 -> 0.0012s1895-- execute("DROP INDEX CONCURRENTLY index_jobs_on_queue")1896 -> 0.0012s1897-- execute("DROP INDEX CONCURRENTLY index_jobs_on_owner_id")1898 -> 0.0011s1899-- execute("DROP INDEX CONCURRENTLY index_builds_on_branch")1900 -> 0.0012s1901-- execute("DROP INDEX CONCURRENTLY index_builds_on_event_type")1902 -> 0.0014s1903-- execute("DROP INDEX CONCURRENTLY index_builds_on_owner_id")1904 -> 0.0011s1905== 20170609174400 DropUnusedIndexesOnJobsAndBuilds: migrated (0.0085s) ========1907== 20170613000000 CreateTrials: migrating =====================================1908-- create_table(:trials, {:id=>:integer})1909 -> 0.0061s1910-- execute("CREATE INDEX CONCURRENTLY index_trials_on_owner ON trials(owner_id, owner_type)")1911 -> 0.0014s1912== 20170613000000 CreateTrials: migrated (0.0079s) ============================1914== 20170620144500 AddIndexesOnBuildsAndJobsAndBranches: migrating =============1915-- execute("CREATE INDEX CONCURRENTLY index_builds_on_repository_id_and_branch_and_id_desc ON builds (repository_id, branch, id DESC)")1916 -> 0.0015s1917-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_owner_id_and_owner_type_and_state ON jobs (owner_id, owner_type, state)")1918 -> 0.0014s1919-- execute("CREATE INDEX CONCURRENTLY index_branches_on_repository_id ON branches (repository_id)")1920 -> 0.0012s1921== 20170620144500 AddIndexesOnBuildsAndJobsAndBranches: migrated (0.0044s) ====1923== 20170621142300 RemovePlansTable: migrating =================================1924-- drop_table(:plans)1925 -> 0.0022s1926== 20170621142300 RemovePlansTable: migrated (0.0023s) ========================1928== 20170713162000 AddCcLastDigitsToInvoices: migrating ========================1929-- change_table(:invoices)1930 -> 0.0015s1931== 20170713162000 AddCcLastDigitsToInvoices: migrated (0.0015s) ===============1933== 20170822171600 CreateMessages: migrating ===================================1934-- create_table("messages", {:force=>:cascade, :id=>:integer})1935 -> 0.0053s1936-- execute("CREATE INDEX CONCURRENTLY index_messages_on_subject_type_and_subject_id ON messages(subject_type, subject_id)")1937 -> 0.0014s1938== 20170822171600 CreateMessages: migrated (0.0070s) ==========================1940== 20170831000000 CreateTrialAllowances: migrating ============================1941-- create_table(:trial_allowances, {:id=>:integer})1942 -> 0.0043s1943-- add_index(:trial_allowances, :trial_id)1944 -> 0.0013s1945-- add_index(:trial_allowances, [:creator_id, :creator_type])1946 -> 0.0011s1947== 20170831000000 CreateTrialAllowances: migrated (0.0068s) ===================1949== 20170911172800 AddIndexOnJobsUpdatedAt: migrating ==========================1950-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_updated_at ON jobs (updated_at)")1951 -> 0.0014s1952== 20170911172800 AddIndexOnJobsUpdatedAt: migrated (0.0015s) =================1954== 20171017104500 AddConcurrencyToSubscriptions: migrating ====================1955-- change_table(:subscriptions)1956 -> 0.0014s1957== 20171017104500 AddConcurrencyToSubscriptions: migrated (0.0014s) ===========1959== 20171024000000 AddAbuseTable: migrating ====================================1960-- create_table(:abuses, {:id=>:integer})1961 -> 0.0042s1962-- execute("CREATE INDEX CONCURRENTLY index_abuses_on_owner ON abuses(owner_id)")1963 -> 0.0011s1964== 20171024000000 AddAbuseTable: migrated (0.0056s) ===========================1966== 20171025000000 AddUpdatedAtTriggerToBuildsAndJobs: migrating ===============1967-- execute(" CREATE FUNCTION set_updated_at() RETURNS trigger AS $$\n BEGIN\n IF TG_OP = 'INSERT' OR\n (TG_OP = 'UPDATE' AND NEW.* IS DISTINCT FROM OLD.*) THEN\n NEW.updated_at := statement_timestamp();\n END IF;\n RETURN NEW;\n END;\n $$ LANGUAGE plpgsql;\n\n CREATE TRIGGER set_updated_at_on_builds\n BEFORE INSERT OR UPDATE ON builds\n FOR EACH ROW\n EXECUTE PROCEDURE set_updated_at();\n\n CREATE TRIGGER set_updated_at_on_jobs\n BEFORE INSERT OR UPDATE ON jobs\n FOR EACH ROW\n EXECUTE PROCEDURE set_updated_at();\n")1968 -> 0.0017s1969== 20171025000000 AddUpdatedAtTriggerToBuildsAndJobs: migrated (0.0018s) ======1971== 20171103000000 UpdateIndexOnAbuses: migrating ==============================1972-- index_exists?(:abuses, :owner, {:name=>"index_abuses_on_owner"})1973 -> 0.0030s1974-- index_exists?(:abuses, [:owner_id, :owner_type, :level], {:name=>"index_abuses_on_owner_id_and_owner_type_and_level"})1975 -> 0.0026s1976-- add_index(:abuses, [:owner_id, :owner_type, :level], {:unique=>true, :algorithm=>:concurrently})1977 -> 0.0015s1978== 20171103000000 UpdateIndexOnAbuses: migrated (0.0074s) =====================1980== 20171211000000 AddRepositoryIdBranchEventTypeIndexOnBuilds: migrating ======1981-- execute("CREATE INDEX CONCURRENTLY index_builds_on_repository_id_and_branch_and_event_type ON builds (repository_id, branch, event_type) WHERE state IN ('created', 'queued', 'received')")1982 -> 0.0019s1983== 20171211000000 AddRepositoryIdBranchEventTypeIndexOnBuilds: migrated (0.0021s)1985== 20180212000000 UsersAddSuspended: migrating ================================1986-- add_column(:users, :suspended, :boolean, {:default=>false})1987 -> 0.0042s1988== 20180212000000 UsersAddSuspended: migrated (0.0043s) =======================1990== 20180213000000 UsersAddSuspendedAt: migrating ==============================1991-- add_column(:users, :suspended_at, :timestamp, {:precision=>nil})1992 -> 0.0015s1993== 20180213000000 UsersAddSuspendedAt: migrated (0.0015s) =====================1995== 20180222000000 AddComIdAndOrgId: migrating =================================1996-- add_column(:branches, :org_id, :integer)1997 -> 0.0016s1998-- add_column(:builds, :org_id, :integer)1999 -> 0.0010s2000-- add_column(:commits, :org_id, :integer)2001 -> 0.0008s2002-- add_column(:crons, :org_id, :integer)2003 -> 0.0007s2004-- add_column(:jobs, :org_id, :integer)2005 -> 0.0010s2006-- add_column(:organizations, :org_id, :integer)2007 -> 0.0009s2008-- add_column(:permissions, :org_id, :integer)2009 -> 0.0008s2010-- add_column(:pull_requests, :org_id, :integer)2011 -> 0.0008s2012-- add_column(:repositories, :org_id, :integer)2013 -> 0.0009s2014-- add_column(:requests, :org_id, :integer)2015 -> 0.0013s2016-- add_column(:ssl_keys, :org_id, :integer)2017 -> 0.0009s2018-- add_column(:stages, :org_id, :integer)2019 -> 0.0008s2020-- add_column(:tags, :org_id, :integer)2021 -> 0.0008s2022-- add_column(:users, :org_id, :integer)2023 -> 0.0009s2024-- add_column(:branches, :com_id, :integer)2025 -> 0.0008s2026-- add_column(:builds, :com_id, :integer)2027 -> 0.0007s2028-- add_column(:commits, :com_id, :integer)2029 -> 0.0006s2030-- add_column(:crons, :com_id, :integer)2031 -> 0.0007s2032-- add_column(:jobs, :com_id, :integer)2033 -> 0.0008s2034-- add_column(:organizations, :com_id, :integer)2035 -> 0.0008s2036-- add_column(:permissions, :com_id, :integer)2037 -> 0.0007s2038-- add_column(:pull_requests, :com_id, :integer)2039 -> 0.0007s2040-- add_column(:repositories, :com_id, :integer)2041 -> 0.0008s2042-- add_column(:requests, :com_id, :integer)2043 -> 0.0008s2044-- add_column(:ssl_keys, :com_id, :integer)2045 -> 0.0009s2046-- add_column(:stages, :com_id, :integer)2047 -> 0.0007s2048-- add_column(:tags, :com_id, :integer)2049 -> 0.0008s2050-- add_column(:users, :com_id, :integer)2051 -> 0.0007s2052== 20180222000000 AddComIdAndOrgId: migrated (0.0252s) ========================2054== 20180222000001 AddComIdAndOrgIdIndices: migrating ==========================2055-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_branches_on_org_id ON branches USING btree (org_id)")2056 -> 0.0014s2057-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_builds_on_org_id ON builds USING btree (org_id)")2058 -> 0.0015s2059-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_jobs_on_org_id ON jobs USING btree (org_id)")2060 -> 0.0013s2061-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_commits_on_org_id ON commits USING btree (org_id)")2062 -> 0.0014s2063-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_crons_on_org_id ON crons USING btree (org_id)")2064 -> 0.0012s2065-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_organizations_on_org_id ON organizations USING btree (org_id)")2066 -> 0.0012s2067-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_permissions_on_org_id ON permissions USING btree (org_id)")2068 -> 0.0017s2069-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_pull_requests_on_org_id ON pull_requests USING btree (org_id)")2070 -> 0.0014s2071-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_repositories_on_org_id ON repositories USING btree (org_id)")2072 -> 0.0018s2073-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_requests_on_org_id ON requests USING btree (org_id)")2074 -> 0.0014s2075-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_ssl_keys_on_org_id ON ssl_keys USING btree (org_id)")2076 -> 0.0013s2077-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_stages_on_org_id ON stages USING btree (org_id)")2078 -> 0.0015s2079-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_tags_on_org_id ON tags USING btree (org_id)")2080 -> 0.0014s2081-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_users_on_org_id ON users USING btree (org_id)")2082 -> 0.0015s2083-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_branches_on_com_id ON branches USING btree (com_id)")2084 -> 0.0014s2085-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_builds_on_com_id ON builds USING btree (com_id)")2086 -> 0.0015s2087-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_jobs_on_com_id ON jobs USING btree (com_id)")2088 -> 0.0014s2089-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_commits_on_com_id ON commits USING btree (com_id)")2090 -> 0.0012s2091-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_crons_on_com_id ON crons USING btree (com_id)")2092 -> 0.0014s2093-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_organizations_on_com_id ON organizations USING btree (com_id)")2094 -> 0.0014s2095-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_permissions_on_com_id ON permissions USING btree (com_id)")2096 -> 0.0013s2097-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_pull_requests_on_com_id ON pull_requests USING btree (com_id)")2098 -> 0.0013s2099-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_repositories_on_com_id ON repositories USING btree (com_id)")2100 -> 0.0021s2101-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_requests_on_com_id ON requests USING btree (com_id)")2102 -> 0.0014s2103-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_ssl_keys_on_com_id ON ssl_keys USING btree (com_id)")2104 -> 0.0013s2105-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_stages_on_com_id ON stages USING btree (com_id)")2106 -> 0.0013s2107-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_tags_on_com_id ON tags USING btree (com_id)")2108 -> 0.0012s2109-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_users_on_com_id ON users USING btree (com_id)")2110 -> 0.0014s2111== 20180222000001 AddComIdAndOrgIdIndices: migrated (0.0410s) =================2113== 20180222000002 AddMigrating: migrating =====================================2114-- add_column(:repositories, :migrating, :boolean)2115 -> 0.0014s2116-- add_column(:repositories, :migrated_at, :timestamp, {:precision=>nil})2117 -> 0.0009s2118-- add_column(:organizations, :migrating, :boolean)2119 -> 0.0008s2120-- add_column(:organizations, :migrated_at, :timestamp, {:precision=>nil})2121 -> 0.0006s2122-- add_column(:users, :migrating, :boolean)2123 -> 0.0007s2124-- add_column(:users, :migrated_at, :timestamp, {:precision=>nil})2125 -> 0.0007s2126== 20180222000002 AddMigrating: migrated (0.0053s) ============================2128== 20180222000003 DropFkRepositoriesCurrentBuildId: migrating =================2129-- execute("ALTER TABLE repositories DROP CONSTRAINT fk_repositories_current_build_id")2130 -> 0.0019s2131== 20180222000003 DropFkRepositoriesCurrentBuildId: migrated (0.0019s) ========2133== 20180222000009 CreateRepoCounts: migrating =================================2134-- create_table(:repo_counts, {:id=>false})2135 -> 0.0035s2136-- add_index(:repo_counts, :repository_id)2137 -> 0.0013s2138== 20180222000009 CreateRepoCounts: migrated (0.0050s) ========================2140== 20180222000012 CreateRepoCountsTriggers: migrating =========================2141-- execute("create or replace function count_requests() returns trigger as $$\ndeclare\n c text;\n r record;\nbegin\n if tg_argv[0]::int > 0 then r := new; else r := old; end if;\n if r.repository_id is not null then\n insert into repo_counts(repository_id, requests)\n values(r.repository_id, tg_argv[0]::int);\n end if;\n return r;\nexception when others then\n get stacked diagnostics c = pg_exception_context;\n raise warning '% context: %s', sqlerrm, c;\n return r;\nend;\n$$\nlanguage plpgsql;\ndrop trigger if exists trg_count_request_inserted on requests;\ncreate trigger trg_count_request_inserted after insert on requests\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_requests(1);\ndrop trigger if exists trg_count_request_deleted on requests;\ncreate trigger trg_count_request_deleted after delete on requests\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_requests('-1');\n\ncreate or replace function count_commits() returns trigger as $$\ndeclare\n c text;\n r record;\nbegin\n if tg_argv[0]::int > 0 then r := new; else r := old; end if;\n if r.repository_id is not null then\n insert into repo_counts(repository_id, commits)\n values(r.repository_id, tg_argv[0]::int);\n end if;\n return r;\nexception when others then\n get stacked diagnostics c = pg_exception_context;\n raise warning '% context: %s', sqlerrm, c;\n return r;\nend;\n$$\nlanguage plpgsql;\ndrop trigger if exists trg_count_commit_inserted on commits;\ncreate trigger trg_count_commit_inserted after insert on commits\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_commits(1);\ndrop trigger if exists trg_count_commit_deleted on commits;\ncreate trigger trg_count_commit_deleted after delete on commits\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_commits('-1');\n\ncreate or replace function count_branches() returns trigger as $$\ndeclare\n c text;\n r record;\nbegin\n if tg_argv[0]::int > 0 then r := new; else r := old; end if;\n if r.repository_id is not null then\n insert into repo_counts(repository_id, branches)\n values(r.repository_id, tg_argv[0]::int);\n end if;\n return r;\nexception when others then\n get stacked diagnostics c = pg_exception_context;\n raise warning '% context: %s', sqlerrm, c;\n return r;\nend;\n$$\nlanguage plpgsql;\ndrop trigger if exists trg_count_branch_inserted on branches;\ncreate trigger trg_count_branch_inserted after insert on branches\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_branches(1);\ndrop trigger if exists trg_count_branch_deleted on branches;\ncreate trigger trg_count_branch_deleted after delete on branches\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_branches('-1');\n\ncreate or replace function count_pull_requests() returns trigger as $$\ndeclare\n c text;\n r record;\nbegin\n if tg_argv[0]::int > 0 then r := new; else r := old; end if;\n if r.repository_id is not null then\n insert into repo_counts(repository_id, pull_requests)\n values(r.repository_id, tg_argv[0]::int);\n end if;\n return r;\nexception when others then\n get stacked diagnostics c = pg_exception_context;\n raise warning '% context: %s', sqlerrm, c;\n return r;\nend;\n$$\nlanguage plpgsql;\ndrop trigger if exists trg_count_pull_request_inserted on pull_requests;\ncreate trigger trg_count_pull_request_inserted after insert on pull_requests\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_pull_requests(1);\ndrop trigger if exists trg_count_pull_request_deleted on pull_requests;\ncreate trigger trg_count_pull_request_deleted after delete on pull_requests\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_pull_requests('-1');\n\ncreate or replace function count_tags() returns trigger as $$\ndeclare\n c text;\n r record;\nbegin\n if tg_argv[0]::int > 0 then r := new; else r := old; end if;\n if r.repository_id is not null is not null then\n insert into repo_counts(repository_id, tags)\n values(r.repository_id, tg_argv[0]::int);\n end if;\n return r;\nexception when others then\n get stacked diagnostics c = pg_exception_context;\n raise warning '% context: %s', sqlerrm, c;\n return r;\nend;\n$$\nlanguage plpgsql;\ndrop trigger if exists trg_count_tag_inserted on tags;\ncreate trigger trg_count_tag_inserted after insert on tags\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_tags(1);\ndrop trigger if exists trg_count_tag_deleted on tags;\ncreate trigger trg_count_tag_deleted after delete on tags\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_tags('-1');\n\ncreate or replace function count_builds() returns trigger as $$\ndeclare\n c text;\n r record;\nbegin\n if tg_argv[0]::int > 0 then r := new; else r := old; end if;\n if r.repository_id is not null then\n insert into repo_counts(repository_id, builds)\n values(r.repository_id, tg_argv[0]::int);\n end if;\n return r;\nexception when others then\n get stacked diagnostics c = pg_exception_context;\n raise warning '% context: %s', sqlerrm, c;\n return r;\nend;\n$$\nlanguage plpgsql;\ndrop trigger if exists trg_count_build_inserted on builds;\ncreate trigger trg_count_build_inserted after insert on builds\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_builds(1);\ndrop trigger if exists trg_count_build_deleted on builds;\ncreate trigger trg_count_build_deleted after delete on builds\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_builds('-1');\n\n-- -- todo stages really should have a repository_id\n-- create or replace function count_stages() returns trigger as $$\n-- declare\n-- c text;\n-- r record;\n-- build record;\n-- begin\n-- if tg_argv[0]::int > 0 then r := new; else r := old; end if;\n-- select repository_id from builds as b where b.id = r.build_id into build;\n-- if build.repository_id is not null then\n-- insert into repo_counts(repository_id, stages)\n-- values(build.repository_id, tg_argv[0]::int);\n-- end if;\n-- return r;\n-- exception when others then\n-- get stacked diagnostics c = pg_exception_context;\n-- raise warning '% context: %s', sqlerrm, c;\n-- return r;\n-- end;\n-- $$\n-- language plpgsql;\n-- drop trigger if exists trg_count_stage_inserted on stages;\n-- create trigger trg_count_stage_inserted after insert on stages\n-- for each row when (now() > '2018-01-01 00:00:00') execute procedure count_stages(1);\n-- drop trigger if exists trg_count_stage_deleted on stages;\n-- create trigger trg_count_stage_deleted after delete on stages\n-- for each row when (now() > '2018-01-01 00:00:00') execute procedure count_stages('-1');\n\ncreate or replace function count_jobs() returns trigger as $$\ndeclare\n c text;\n r record;\nbegin\n if tg_argv[0]::int > 0 then r := new; else r := old; end if;\n if r.repository_id is not null then\n insert into repo_counts(repository_id, jobs)\n values(r.repository_id, tg_argv[0]::int);\n end if;\n return r;\nexception when others then\n get stacked diagnostics c = pg_exception_context;\n raise warning '% context: %s', sqlerrm, c;\n return r;\nend;\n$$\nlanguage plpgsql;\ndrop trigger if exists trg_count_job_inserted on jobs;\ncreate trigger trg_count_job_inserted after insert on jobs\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_jobs(1);\ndrop trigger if exists trg_count_job_deleted on jobs;\ncreate trigger trg_count_job_deleted after delete on jobs\nfor each row when (now() > '2018-01-01 00:00:00') execute procedure count_jobs('-1');\n\ndrop function if exists count_requests(_start int, _end int);\ncreate or replace function count_requests(_start int, _end int)\nreturns table (repository_id int, requests bigint, range varchar) as $$\nbegin\n return query select t.repository_id, count(id) as requests, ('requests' || ':' || _start || ':' || _end)::varchar as range\n from requests as t\n where t.id between _start and _end and t.created_at <= '2018-01-01 00:00:00' and t.repository_id is not null\n group by t.repository_id;\nend;\n$$\nlanguage plpgsql;\n\ndrop function if exists count_commits(_start int, _end int);\ncreate or replace function count_commits(_start int, _end int)\nreturns table (repository_id int, commits bigint, range varchar) as $$\nbegin\n return query select r.id, count(t.id) as commits, ('commits' || ':' || _start || ':' || _end)::varchar as range\n from commits as t\n join repositories as r on t.repository_id = r.id\n where t.id between _start and _end and t.created_at <= '2018-01-01 00:00:00' and t.repository_id is not null\n group by r.id;\nend;\n$$\nlanguage plpgsql;\n\ndrop function if exists count_branches(_start int, _end int);\ncreate or replace function count_branches(_start int, _end int)\nreturns table (repository_id int, branches bigint, range varchar) as $$\nbegin\n return query select r.id, count(t.id) as branches, ('branches' || ':' || _start || ':' || _end)::varchar as range\n from branches as t\n join repositories as r on t.repository_id = r.id\n where t.id between _start and _end and t.created_at <= '2018-01-01 00:00:00' and t.repository_id is not null\n group by r.id;\nend;\n$$\nlanguage plpgsql;\n\ndrop function if exists count_pull_requests(_start int, _end int);\ncreate or replace function count_pull_requests(_start int, _end int)\nreturns table (repository_id int, pull_requests bigint, range varchar) as $$\nbegin\n return query select r.id, count(t.id) as pull_requests, ('pull_requests' || ':' || _start || ':' || _end)::varchar as range\n from pull_requests as t\n join repositories as r on t.repository_id = r.id\n where t.id between _start and _end and t.created_at <= '2018-01-01 00:00:00' and t.repository_id is not null\n group by r.id;\nend;\n$$\nlanguage plpgsql;\n\ndrop function if exists count_tags(_start int, _end int);\ncreate or replace function count_tags(_start int, _end int)\nreturns table (repository_id int, tags bigint, range varchar) as $$\nbegin\n return query select r.id, count(t.id) as tags, ('tags' || ':' || _start || ':' || _end)::varchar as range\n from tags as t\n join repositories as r on t.repository_id = r.id\n where t.id between _start and _end and t.created_at <= '2018-01-01 00:00:00' and t.repository_id is not null\n group by r.id;\nend;\n$$\nlanguage plpgsql;\n\ndrop function if exists count_builds(_start int, _end int);\ncreate or replace function count_builds(_start int, _end int)\nreturns table (repository_id int, builds bigint, range varchar) as $$\nbegin\n return query select t.repository_id, count(id) as builds, ('builds' || ':' || _start || ':' || _end)::varchar as range\n from builds as t\n where t.id between _start and _end and t.created_at <= '2018-01-01 00:00:00' and t.repository_id is not null\n group by t.repository_id;\nend;\n$$\nlanguage plpgsql;\n\n-- drop function if exists count_stages(_start int, _end int);\n-- create or replace function count_stages(_start int, _end int)\n-- returns table (repository_id int, stages bigint, range varchar) as $$\n-- begin\n-- return query select b.repository_id, count(t.id) as stages, ('stages' || ':' || _start || ':' || _end)::varchar as range\n-- from stages as t\n-- join builds as b on t.build_id = b.id\n-- where t.id between _start and _end and b.created_at <= '2018-01-01 00:00:00' and b.repository_id is not null\n-- group by b.repository_id;\n-- end;\n-- $$\n-- language plpgsql;\n\ndrop function if exists count_jobs(_start int, _end int);\ncreate or replace function count_jobs(_start int, _end int)\nreturns table (repository_id int, jobs bigint, range varchar) as $$\nbegin\n return query select t.repository_id, count(id) as jobs, ('jobs' || ':' || _start || ':' || _end)::varchar as range\n from jobs as t\n where t.id between _start and _end and t.created_at <= '2018-01-01 00:00:00' and t.repository_id is not null\n group by t.repository_id;\nend;\n$$\nlanguage plpgsql;\n\ndrop function if exists count_all_requests(_count int, _start int, _end int);\ncreate or replace function count_all_requests(_count int, _start int, _end int) returns boolean as $$\ndeclare max int;\nbegin\n select id + _count from requests order by id desc limit 1 into max;\n for i in _start.._end by _count loop\n if i > max then exit; end if;\n begin\n raise notice 'counting requests %', i;\n insert into repo_counts(repository_id, requests, range)\n select * from count_requests(i, i + _count - 1);\n exception when unique_violation then end;\n end loop;\n\n return true;\nend\n$$\nlanguage plpgsql;\n\ndrop function if exists count_all_commits(_count int, _start int, _end int);\ncreate or replace function count_all_commits(_count int, _start int, _end int) returns boolean as $$\ndeclare max int;\nbegin\n select id + _count from commits order by id desc limit 1 into max;\n\n for i in _start.._end by _count loop\n if i > max then exit; end if;\n begin\n raise notice 'counting commits %', i;\n insert into repo_counts(repository_id, commits, range)\n select * from count_commits(i, i + _count - 1);\n exception when unique_violation then end;\n end loop;\n\n return true;\nend\n$$\nlanguage plpgsql;\n\ndrop function if exists count_all_branches(_count int, _start int, _end int);\ncreate or replace function count_all_branches(_count int, _start int, _end int) returns boolean as $$\ndeclare max int;\nbegin\n select id + _count from branches order by id desc limit 1 into max;\n\n for i in _start.._end by _count loop\n if i > max then exit; end if;\n begin\n raise notice 'counting branches %', i;\n insert into repo_counts(repository_id, branches, range)\n select * from count_branches(i, i + _count - 1);\n exception when unique_violation then end;\n end loop;\n\n return true;\nend\n$$\nlanguage plpgsql;\n\ndrop function if exists count_all_pull_requests(_count int, _start int, _end int);\ncreate or replace function count_all_pull_requests(_count int, _start int, _end int) returns boolean as $$\ndeclare max int;\nbegin\n select id + _count from pull_requests order by id desc limit 1 into max;\n\n for i in _start.._end by _count loop\n if i > max then exit; end if;\n begin\n raise notice 'counting pull_requests %', i;\n insert into repo_counts(repository_id, pull_requests, range)\n select * from count_pull_requests(i, i + _count - 1);\n exception when unique_violation then end;\n end loop;\n\n return true;\nend\n$$\nlanguage plpgsql;\n\ndrop function if exists count_all_tags(_count int, _start int, _end int);\ncreate or replace function count_all_tags(_count int, _start int, _end int) returns boolean as $$\ndeclare max int;\nbegin\n select id + _count from tags order by id desc limit 1 into max;\n\n for i in _start.._end by _count loop\n if i > max then exit; end if;\n begin\n raise notice 'counting tags %', i;\n insert into repo_counts(repository_id, tags, range)\n select * from count_tags(i, i + _count - 1);\n exception when unique_violation then end;\n end loop;\n\n return true;\nend\n$$\nlanguage plpgsql;\n\ndrop function if exists count_all_builds(_count int, _start int, _end int);\ncreate or replace function count_all_builds(_count int, _start int, _end int) returns boolean as $$\ndeclare max int;\nbegin\n select id + _count from builds order by id desc limit 1 into max;\n\n for i in _start.._end by _count loop\n if i > max then exit; end if;\n begin\n raise notice 'counting builds %', i;\n insert into repo_counts(repository_id, builds, range)\n select * from count_builds(i, i + _count - 1);\n exception when unique_violation then end;\n end loop;\n\n return true;\nend\n$$\nlanguage plpgsql;\n\n-- drop function if exists count_all_stages(_count int, _start int, _end int);\n-- create or replace function count_all_stages(_count int, _start int, _end int) returns boolean as $$\n-- declare max int;\n-- begin\n-- select id + _count from stages order by id desc limit 1 into max;\n--\n-- for i in _start.._end by _count loop\n-- if i > max then exit; end if;\n-- begin\n-- raise notice 'counting stages %', i;\n-- insert into repo_counts(repository_id, stages, range)\n-- select * from count_stages(i, i + _count - 1);\n-- exception when unique_violation then end;\n-- end loop;\n--\n-- return true;\n-- end\n-- $$\n-- language plpgsql;\n\ndrop function if exists count_all_jobs(_count int, _start int, _end int);\ncreate or replace function count_all_jobs(_count int, _start int, _end int) returns boolean as $$\ndeclare max int;\nbegin\n select id + _count from jobs order by id desc limit 1 into max;\n\n for i in _start.._end by _count loop\n if i > max then exit; end if;\n begin\n raise notice 'counting jobs %', i;\n insert into repo_counts(repository_id, jobs, range)\n select * from count_jobs(i, i + _count - 1);\n exception when unique_violation then end;\n end loop;\n\n return true;\nend\n$$\nlanguage plpgsql;\n\n\ncreate or replace function agg_all_repo_counts()\nreturns boolean as $$\nbegin\n with src as (\n select cnt.repository_id\n from repo_counts cnt\n group by cnt.repository_id\n having count(1) > 1\n ),\n del as (\n delete from repo_counts cnt\n using src\n where cnt.repository_id = src.repository_id\n returning cnt.*\n ),\n agg as (\n select\n del.repository_id,\n sum(del.requests)::integer as requests,\n sum(del.commits)::integer as commits,\n sum(del.branches)::integer as branches,\n sum(del.pull_requests)::integer as pull_requests,\n sum(del.tags)::integer as tags,\n sum(del.builds)::integer as builds,\n -- sum(del.stages)::integer as stages,\n sum(del.jobs)::integer as jobs\n from del\n group by del.repository_id\n )\n insert into repo_counts(\n repository_id,\n requests,\n commits,\n branches,\n pull_requests,\n tags,\n builds,\n -- stages,\n jobs\n )\n select\n agg.repository_id,\n agg.requests,\n agg.commits,\n agg.branches,\n agg.pull_requests,\n agg.tags,\n agg.builds,\n -- agg.stages,\n agg.jobs\n from agg;\n\n return true;\nend;\n$$\nlanguage plpgsql;\n\ncreate or replace function agg_repo_counts(_repo_id int)\nreturns boolean as $$\nbegin\n with src as (\n select cnt.repository_id\n from repo_counts cnt\n where cnt.repository_id = _repo_id\n group by cnt.repository_id\n having count(1) > 1\n ),\n del as (\n delete from repo_counts cnt\n using src\n where cnt.repository_id = src.repository_id\n returning cnt.*\n ),\n agg as (\n select\n del.repository_id,\n sum(del.requests)::integer as requests,\n sum(del.commits)::integer as commits,\n sum(del.branches)::integer as branches,\n sum(del.pull_requests)::integer as pull_requests,\n sum(del.tags)::integer as tags,\n sum(del.builds)::integer as builds,\n -- sum(del.stages)::integer as stages,\n sum(del.jobs)::integer as jobs\n from del\n group by del.repository_id\n )\n insert into repo_counts(\n repository_id,\n requests,\n commits,\n branches,\n pull_requests,\n tags,\n builds,\n -- stages,\n jobs\n )\n select\n agg.repository_id,\n agg.requests,\n agg.commits,\n agg.branches,\n agg.pull_requests,\n agg.tags,\n agg.builds,\n -- agg.stages,\n agg.jobs\n from agg\n where agg.requests > 0 or agg.builds > 0 or agg.jobs > 0;\n\n return true;\nend;\n$$\nlanguage plpgsql;\n")2142 -> 0.0205s2143== 20180222000012 CreateRepoCountsTriggers: migrated (0.0215s) ================2145== 20180222164100 DropAnnotations: migrating ==================================2146-- drop_table(:annotations)2147 -> 0.0033s2148-- drop_table(:annotation_providers)2149 -> 0.0025s2150== 20180222164100 DropAnnotations: migrated (0.0059s) =========================2152== 20180305143800 IndexBuildsOnRepositoryIdWhereStateNotFinished: migrating ===2153-- execute("CREATE INDEX CONCURRENTLY index_builds_on_repository_id_where_state_not_finished ON builds (repository_id) WHERE state IN ('created', 'queued', 'received', 'started');")2154 -> 0.0022s2155== 20180305143800 IndexBuildsOnRepositoryIdWhereStateNotFinished: migrated (0.0022s)2157== 20180321102400 IndexJobsOnRepositoryIdWhereStateRunning: migrating =========2158-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_repository_id_where_state_running ON jobs (repository_id) WHERE state IN ('queued', 'received', 'started')")2159 -> 0.0018s2160== 20180321102400 IndexJobsOnRepositoryIdWhereStateRunning: migrated (0.0018s)2162== 20180330000000 CreateRequestPayloads: migrating ============================2163-- create_table(:request_payloads, {:id=>:integer})2164 -> 0.0055s2165-- add_index(:request_payloads, :request_id)2166 -> 0.0011s2167-- add_index(:request_payloads, [:created_at, :archived])2168 -> 0.0012s2169== 20180330000000 CreateRequestPayloads: migrated (0.0080s) ===================2171== 20180331000000 CreateConfigs: migrating ====================================2172-- create_table(:request_configs, {:id=>:integer})2173 -> 0.0050s2174-- create_table(:build_configs, {:id=>:integer})2175 -> 0.0047s2176-- create_table(:job_configs, {:id=>:integer})2177 -> 0.0045s2178-- add_index(:request_configs, [:repository_id, :key])2179 -> 0.0012s2180-- add_index(:build_configs, [:repository_id, :key])2181 -> 0.0011s2182-- add_index(:job_configs, [:repository_id, :key])2183 -> 0.0011s2184-- add_column(:requests, :config_id, :integer)2185 -> 0.0013s2186-- add_column(:builds, :config_id, :integer)2187 -> 0.0010s2188-- add_column(:jobs, :config_id, :integer)2189 -> 0.0008s2190== 20180331000000 CreateConfigs: migrated (0.0213s) ===========================2192== 20180404000001 CreateInstallations: migrating ==============================2193-- create_table(:installations, {:id=>:integer})2194 -> 0.0099s2195-- change_table(:repositories)2196 -> 0.0017s2197== 20180404000001 CreateInstallations: migrated (0.0117s) =====================2199== 20180410000000 RequestsDropPayload: migrating ==============================2200-- remove_column(:requests, :payload, :text)2201 -> 0.0013s2202== 20180410000000 RequestsDropPayload: migrated (0.0014s) =====================2204== 20180413000000 IndexBranchesOnRepositoryIdAndNameAndId: migrating ==========2205-- execute("CREATE INDEX CONCURRENTLY index_branches_on_repository_id_and_name_and_id ON branches (repository_id, name, id)")2206 -> 0.0014s2207-- execute("DROP INDEX CONCURRENTLY index_branches_on_repository_id_and_name")2208 -> 0.0012s2209== 20180413000000 IndexBranchesOnRepositoryIdAndNameAndId: migrated (0.0028s) =2211== 20180417000000 IndexBuildsOrganizationsUsersOnUpdatedAt: migrating =========2212-- execute("CREATE INDEX CONCURRENTLY index_builds_on_updated_at ON builds (updated_at)")2213 -> 0.0016s2214-- execute("CREATE INDEX CONCURRENTLY index_users_on_updated_at ON users (updated_at)")2215 -> 0.0018s2216-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_updated_at ON repositories (updated_at)")2217 -> 0.0015s2218-- execute("CREATE INDEX CONCURRENTLY index_organizations_on_updated_at ON organizations (updated_at)")2219 -> 0.0014s2220== 20180417000000 IndexBuildsOrganizationsUsersOnUpdatedAt: migrated (0.0066s)2222== 20180420000000 ConstraintsAndIndexesForGhApps: migrating ===================2223-- execute("CREATE UNIQUE INDEX CONCURRENTLY github_id_installations_idx ON installations (github_id)")2224 -> 0.0014s2225-- execute("CREATE INDEX CONCURRENTLY managed_repositories_idx ON repositories (managed_by_installation_at)")2226 -> 0.0014s2227-- execute("CREATE UNIQUE INDEX CONCURRENTLY owner_installations_idx ON installations (owner_id, owner_type) WHERE removed_by_id IS NULL")2228 -> 0.0017s2229== 20180420000000 ConstraintsAndIndexesForGhApps: migrated (0.0047s) ==========2231== 20180425000000 IndexActiveOnOrg: migrating =================================2232-- execute("CREATE INDEX CONCURRENTLY index_active_on_org ON repositories (active_on_org)")2233 -> 0.0015s2234== 20180425000000 IndexActiveOnOrg: migrated (0.0016s) ========================2236== 20180425100000 AddRemovedAtOnInstallations: migrating ======================2237-- add_column(:installations, :removed_at, :timestamp, {:precision=>nil})2238 -> 0.0013s2239== 20180425100000 AddRemovedAtOnInstallations: migrated (0.0013s) =============2241== 20180429000000 IndexRepositoriesOnOwnerNameAndName: migrating ==============2242-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_owner_name_and_name ON repositories (owner_name, name) WHERE invalidated_at IS NULL")2243 -> 0.0017s2244== 20180429000000 IndexRepositoriesOnOwnerNameAndName: migrated (0.0018s) =====2246== 20180501000000 IndexJobsOnOwnerWhereStateRunning: migrating ================2247-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_owner_where_state_running ON jobs (owner_id, owner_type) WHERE state IN ('queued', 'received', 'started')")2248 -> 0.0021s2249== 20180501000000 IndexJobsOnOwnerWhereStateRunning: migrated (0.0021s) =======2251== 20180517000000 IndexRequestsConfigId: migrating ============================2252-- execute("CREATE INDEX CONCURRENTLY index_requests_on_config_id ON requests (config_id)")2253 -> 0.0017s2254== 20180517000000 IndexRequestsConfigId: migrated (0.0017s) ===================2256== 20180517000001 IndexBuildsConfigId: migrating ==============================2257-- execute("CREATE INDEX CONCURRENTLY index_builds_on_config_id ON requests (config_id)")2258 -> 0.0016s2259== 20180517000001 IndexBuildsConfigId: migrated (0.0018s) =====================2261== 20180517000002 IndexJobsConfigId: migrating ================================2262-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_config_id ON requests (config_id)")2263 -> 0.0014s2264== 20180517000002 IndexJobsConfigId: migrated (0.0016s) =======================2266== 20180518000000 IndexBuildsOnMultiple: migrating ============================2267-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_builds_on_repo_branch_event_type_and_private ON builds (repository_id, branch, event_type, private)")2268 -> 0.0019s2269== 20180518000000 IndexBuildsOnMultiple: migrated (0.0019s) ===================2271== 20180522000000 AddActiveFlagToCrons: migrating =============================2272-- change_table(:crons)2273 -> 0.0070s2274-- add_index(:crons, :next_run, {:where=>"(active IS TRUE)", :algorithm=>:concurrently})2275 -> 0.0018s2276== 20180522000000 AddActiveFlagToCrons: migrated (0.0089s) ====================2278== 20180531000000 CreateRequestYamlConfigs: migrating =========================2279-- create_table(:request_yaml_configs, {:id=>:integer})2280 -> 0.0045s2281-- add_index(:request_yaml_configs, [:repository_id, :key])2282 -> 0.0014s2283-- add_column(:requests, :yaml_config_id, :integer)2284 -> 0.0010s2285== 20180531000000 CreateRequestYamlConfigs: migrated (0.0070s) ================2287== 20180606000000 IndexCommitsOnRepositoryId: migrating =======================2288-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_commits_on_repository_id ON commits (repository_id)")2289 -> 0.0015s2290== 20180606000000 IndexCommitsOnRepositoryId: migrated (0.0016s) ==============2292== 20180606000001 IndexJobsOnRepositoryId: migrating ==========================2293-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_jobs_on_repository_id ON jobs (repository_id)")2294 -> 0.0017s2295== 20180606000001 IndexJobsOnRepositoryId: migrated (0.0018s) =================2297== 20180614000000 DropRequestsConfig: migrating ===============================2298-- remove_column(:requests, :config)2299 -> 0.0013s2300== 20180614000000 DropRequestsConfig: migrated (0.0014s) ======================2302== 20180614000001 DropBuildsConfig: migrating =================================2303-- remove_column(:builds, :config)2304 -> 0.0014s2305== 20180614000001 DropBuildsConfig: migrated (0.0015s) ========================2307== 20180614000002 DropJobsConfig: migrating ===================================2308-- remove_column(:jobs, :config)2309 -> 0.0012s2310== 20180614000002 DropJobsConfig: migrated (0.0013s) ==========================2312== 20180620000000 IndexBuildsOnRepositoryIdEventTypeId: migrating =============2313-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_builds_on_repository_id_event_type_id ON builds (repository_id, event_type, id DESC)")2314 -> 0.0024s2315== 20180620000000 IndexBuildsOnRepositoryIdEventTypeId: migrated (0.0024s) ====2317== 20180725000000 CreateCancellations: migrating ==============================2318-- create_table(:cancellations, {:id=>:integer})2319 -> 0.0071s2320== 20180725000000 CreateCancellations: migrated (0.0072s) =====================2322== 20180726000000 CommitsIndexAuthorEmail: migrating ==========================2323-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_commits_on_author_email ON commits (author_email)")2324 -> 0.0018s2325== 20180726000000 CommitsIndexAuthorEmail: migrated (0.0019s) =================2327== 20180726000001 CommitsIndexCommitterEmail: migrating =======================2328-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_commits_on_committer_email ON commits (committer_email)")2329 -> 0.0015s2330== 20180726000001 CommitsIndexCommitterEmail: migrated (0.0016s) ==============2332== 20180801000001 UsersAddRedactedAt: migrating ===============================2333-- change_table(:users)2334 -> 0.0016s2335== 20180801000001 UsersAddRedactedAt: migrated (0.0017s) ======================2337== 20180822000000 CreateEmailUnsubscribes: migrating ==========================2338-- create_table(:email_unsubscribes, {:id=>:integer})2339 -> 0.0081s2340== 20180822000000 CreateEmailUnsubscribes: migrated (0.0082s) =================2342== 20180823000000 AddPreferences: migrating ===================================2343-- change_table(:users)2344 -> 0.0020s2345== 20180823000000 AddPreferences: migrated (0.0022s) ==========================2347== 20180828000000 ChangePreferencesDefault: migrating =========================2348-- change_column_default(:users, :preferences, {})2349 -> 0.0077s2350== 20180828000000 ChangePreferencesDefault: migrated (0.0077s) ================2352== 20180829000000 MakeEmailUnsubscribesIdBigint: migrating ====================2353-- change_column(:email_unsubscribes, :id, :bigint)2354 -> 0.0047s2355== 20180829000000 MakeEmailUnsubscribesIdBigint: migrated (0.0047s) ===========2357== 20180830000001 JobsAddRestartedAt: migrating ===============================2358-- change_table(:jobs)2359 -> 0.0017s2360== 20180830000001 JobsAddRestartedAt: migrated (0.0018s) ======================2362== 20180830000002 BuildsAddRestartedAt: migrating =============================2363-- change_table(:builds)2364 -> 0.0015s2365== 20180830000002 BuildsAddRestartedAt: migrated (0.0015s) ====================2367== 20180830000003 JobVersionsCreate: migrating ================================2368-- create_table(:job_versions, {:id=>:integer})2369 -> 0.0052s2370== 20180830000003 JobVersionsCreate: migrated (0.0053s) =======================2372== 20180903000000 JobConfigsIndexConfigResourcesGpu: migrating ================2373-- execute("CREATE OR REPLACE FUNCTION is_json(text) RETURNS boolean LANGUAGE plpgsql immutable AS $$\n BEGIN\n perform $1::json;\n return true;\n EXCEPTION WHEN invalid_text_representation THEN\n return false;\n END\n$$;\n")2374 -> 0.0009s2375-- execute("CREATE INDEX CONCURRENTLY index_job_configs_on_config_resources_gpu ON job_configs (((config ->> 'resources')::jsonb ->> 'gpu')) WHERE is_json((config ->> 'resources')::text) AND ((config ->> 'resources')::jsonb ->> 'gpu') IS NOT NULL;\n")2376 -> 0.0025s2377== 20180903000000 JobConfigsIndexConfigResourcesGpu: migrated (0.0036s) =======2379== 20180903000001 FixIndexesOnBuildsAndJobsConfigId: migrating ================2380-- execute("DROP INDEX index_builds_on_config_id")2381 -> 0.0010s2382-- execute("CREATE INDEX CONCURRENTLY index_builds_on_config_id ON builds (config_id)")2383 -> 0.0015s2384-- execute("DROP INDEX index_jobs_on_config_id")2385 -> 0.0012s2386-- execute("CREATE INDEX CONCURRENTLY index_jobs_on_config_id ON jobs (config_id)")2387 -> 0.0015s2388== 20180903000001 FixIndexesOnBuildsAndJobsConfigId: migrated (0.0055s) =======2390== 20180904000001 CreateJobConfigsGpu: migrating ==============================2391-- execute("CREATE MATERIALIZED VIEW job_configs_gpu AS\nSELECT id FROM job_configs WHERE\n is_json((config ->> 'resources')::text) AND\n ((config ->> 'resources')::jsonb ->> 'gpu') IS NOT NULL;\n")2392 -> 0.0025s2393== 20180904000001 CreateJobConfigsGpu: migrated (0.0026s) =====================2395== 20180906000000 AddIndexUsersPreferencesBuildEmails: migrating ==============2396-- execute("CREATE INDEX CONCURRENTLY user_preferences_build_emails_false ON users (id) WHERE preferences->>'build_emails' = 'false';\n")2397 -> 0.0017s2398== 20180906000000 AddIndexUsersPreferencesBuildEmails: migrated (0.0017s) =====2400== 20181002115306 DeleteDuplicateRecordsFromMemberships: migrating ============2401-- execute("DELETE FROM memberships WHERE id in (\n\tSELECT a.id FROM\n\t\t(SELECT m.id, row_number() OVER (ORDER BY m.id) as rnum\n FROM (SELECT user_id, organization_id\n FROM memberships\n GROUP BY (user_id, organization_id)\n HAVING count(*) > 1) t\n INNER JOIN memberships m ON m.user_id = t.user_id AND m.organization_id = t.organization_id) AS a\n WHERE mod(a.rnum, 2) = 0);\n")2402 -> 0.0023s2403== 20181002115306 DeleteDuplicateRecordsFromMemberships: migrated (0.0025s) ===2405== 20181002115307 AddConstraintOnOrganizationAndUserToMemberships: migrating ==2406-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_organization_id_and_user_id_on_memberships ON memberships USING btree (organization_id, user_id);\n")2407 -> 0.0014s2408== 20181002115307 AddConstraintOnOrganizationAndUserToMemberships: migrated (0.0015s)2410== 20181018000000 IndexBuildsOnCreatedAt: migrating ===========================2411-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_builds_on_created_at ON builds (created_at)")2412 -> 0.0015s2413== 20181018000000 IndexBuildsOnCreatedAt: migrated (0.0016s) ==================2415== 20181029120000 AddMigrationStatusColumnToRepositories: migrating ===========2416-- add_column(:repositories, :migration_status, :string)2417 -> 0.0015s2418== 20181029120000 AddMigrationStatusColumnToRepositories: migrated (0.0016s) ==2420== 20181113120000 AddGithubGuidColumnToRequests: migrating ====================2421-- add_column(:requests, :github_guid, :text)2422 -> 0.0010s2423-- add_index(:requests, :github_guid, {:algorithm=>:concurrently, :unique=>true})2424 -> 0.0016s2425== 20181113120000 AddGithubGuidColumnToRequests: migrated (0.0028s) ===========2427== 20181116800000 AddConstraintsToMultipleTables: migrating ===================2428-- execute("ALTER TABLE repositories ADD CONSTRAINT fk_repositories_on_current_build_id FOREIGN KEY (current_build_id) REFERENCES builds(id) ON DELETE SET NULL NOT VALID")2429 -> 0.0021s2430-- execute("ALTER TABLE repositories ADD CONSTRAINT fk_repositories_on_last_build_id FOREIGN KEY (last_build_id) REFERENCES builds(id) ON DELETE SET NULL NOT VALID")2431 -> 0.0014s2432-- execute("ALTER TABLE builds ADD CONSTRAINT fk_builds_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) NOT VALID")2433 -> 0.0016s2434-- execute("ALTER TABLE builds ADD CONSTRAINT fk_builds_on_commit_id FOREIGN KEY (commit_id) REFERENCES commits(id) NOT VALID")2435 -> 0.0014s2436-- execute("ALTER TABLE builds ADD CONSTRAINT fk_builds_on_request_id FOREIGN KEY (request_id) REFERENCES requests(id) NOT VALID")2437 -> 0.0013s2438-- execute("ALTER TABLE builds ADD CONSTRAINT fk_builds_on_pull_request_id FOREIGN KEY (pull_request_id) REFERENCES pull_requests(id) NOT VALID")2439 -> 0.0013s2440-- execute("ALTER TABLE builds ADD CONSTRAINT fk_builds_on_branch_id FOREIGN KEY (branch_id) REFERENCES branches(id) NOT VALID")2441 -> 0.0014s2442-- execute("ALTER TABLE builds ADD CONSTRAINT fk_builds_on_tag_id FOREIGN KEY (tag_id) REFERENCES tags(id) NOT VALID")2443 -> 0.0014s2444-- execute("ALTER TABLE builds ADD CONSTRAINT fk_builds_on_config_id FOREIGN KEY (config_id) REFERENCES build_configs(id) NOT VALID")2445 -> 0.0015s2446-- execute("ALTER TABLE jobs ADD CONSTRAINT fk_jobs_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) NOT VALID")2447 -> 0.0014s2448-- execute("ALTER TABLE jobs ADD CONSTRAINT fk_jobs_on_commit_id FOREIGN KEY (commit_id) REFERENCES commits(id) NOT VALID")2449 -> 0.0018s2450-- execute("ALTER TABLE jobs ADD CONSTRAINT fk_jobs_on_stage_id FOREIGN KEY (stage_id) REFERENCES stages(id) NOT VALID")2451 -> 0.0015s2452-- execute("ALTER TABLE jobs ADD CONSTRAINT fk_jobs_on_config_id FOREIGN KEY (config_id) REFERENCES job_configs(id) NOT VALID")2453 -> 0.0074s2454-- execute("ALTER TABLE branches ADD CONSTRAINT fk_branches_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) NOT VALID")2455 -> 0.0083s2456-- execute("ALTER TABLE branches ADD CONSTRAINT fk_branches_on_last_build_id FOREIGN KEY (last_build_id) REFERENCES builds(id) ON DELETE SET NULL NOT VALID")2457 -> 0.0072s2458-- execute("ALTER TABLE tags ADD CONSTRAINT fk_tags_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) NOT VALID")2459 -> 0.0060s2460-- execute("ALTER TABLE tags ADD CONSTRAINT fk_tags_on_last_build_id FOREIGN KEY (last_build_id) REFERENCES builds(id) ON DELETE SET NULL NOT VALID")2461 -> 0.0060s2462-- execute("ALTER TABLE commits ADD CONSTRAINT fk_commits_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) NOT VALID")2463 -> 0.0063s2464-- execute("ALTER TABLE commits ADD CONSTRAINT fk_commits_on_branch_id FOREIGN KEY (branch_id) REFERENCES branches(id) NOT VALID")2465 -> 0.0062s2466-- execute("ALTER TABLE commits ADD CONSTRAINT fk_commits_on_tag_id FOREIGN KEY (tag_id) REFERENCES tags(id) NOT VALID")2467 -> 0.0051s2468-- execute("ALTER TABLE crons ADD CONSTRAINT fk_crons_on_branch_id FOREIGN KEY (branch_id) REFERENCES branches(id) NOT VALID")2469 -> 0.0061s2470-- execute("ALTER TABLE job_configs ADD CONSTRAINT fk_job_configs_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) NOT VALID")2471 -> 0.0062s2472-- execute("ALTER TABLE build_configs ADD CONSTRAINT fk_build_configs_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) NOT VALID")2473 -> 0.0060s2474-- execute("ALTER TABLE pull_requests ADD CONSTRAINT fk_pull_requests_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) NOT VALID")2475 -> 0.0019s2476-- execute("ALTER TABLE ssl_keys ADD CONSTRAINT fk_ssl_keys_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) NOT VALID")2477 -> 0.0082s2478-- execute("ALTER TABLE requests ADD CONSTRAINT fk_requests_on_commit_id FOREIGN KEY (commit_id) REFERENCES commits(id) NOT VALID")2479 -> 0.0095s2480-- execute("ALTER TABLE requests ADD CONSTRAINT fk_requests_on_pull_request_id FOREIGN KEY (pull_request_id) REFERENCES pull_requests(id) NOT VALID")2481 -> 0.0010s2482-- execute("ALTER TABLE requests ADD CONSTRAINT fk_requests_on_branch_id FOREIGN KEY (branch_id) REFERENCES branches(id) NOT VALID")2483 -> 0.0009s2484-- execute("ALTER TABLE requests ADD CONSTRAINT fk_requests_on_tag_id FOREIGN KEY (tag_id) REFERENCES tags(id) NOT VALID")2485 -> 0.0008s2486-- execute("ALTER TABLE requests ADD CONSTRAINT fk_requests_on_config_id FOREIGN KEY (config_id) REFERENCES request_configs(id) NOT VALID")2487 -> 0.0010s2488-- execute("ALTER TABLE stages ADD CONSTRAINT fk_stages_on_build_id FOREIGN KEY (build_id) REFERENCES builds(id) NOT VALID")2489 -> 0.0010s2490== 20181116800000 AddConstraintsToMultipleTables: migrated (0.1341s) ==========2492== 20181116800001 ValidateConstraints: migrating ==============================2493-- execute("ALTER TABLE repositories VALIDATE CONSTRAINT fk_repositories_on_current_build_id")2494 -> 0.0025s2495-- execute("ALTER TABLE repositories VALIDATE CONSTRAINT fk_repositories_on_last_build_id")2496 -> 0.0011s2497-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_builds_on_repository_id")2498 -> 0.0010s2499-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_builds_on_commit_id")2500 -> 0.0011s2501-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_builds_on_request_id")2502 -> 0.0013s2503-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_builds_on_pull_request_id")2504 -> 0.0011s2505-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_builds_on_branch_id")2506 -> 0.0024s2507-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_builds_on_tag_id")2508 -> 0.0022s2509-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_builds_on_config_id")2510 -> 0.0019s2511-- execute("ALTER TABLE jobs VALIDATE CONSTRAINT fk_jobs_on_repository_id")2512 -> 0.0024s2513-- execute("ALTER TABLE jobs VALIDATE CONSTRAINT fk_jobs_on_commit_id")2514 -> 0.0027s2515-- execute("ALTER TABLE jobs VALIDATE CONSTRAINT fk_jobs_on_stage_id")2516 -> 0.0013s2517-- execute("ALTER TABLE jobs VALIDATE CONSTRAINT fk_jobs_on_config_id")2518 -> 0.0017s2519-- execute("ALTER TABLE branches VALIDATE CONSTRAINT fk_branches_on_repository_id")2520 -> 0.0013s2521-- execute("ALTER TABLE branches VALIDATE CONSTRAINT fk_branches_on_last_build_id")2522 -> 0.0015s2523-- execute("ALTER TABLE tags VALIDATE CONSTRAINT fk_tags_on_repository_id")2524 -> 0.0012s2525-- execute("ALTER TABLE tags VALIDATE CONSTRAINT fk_tags_on_last_build_id")2526 -> 0.0013s2527-- execute("ALTER TABLE commits VALIDATE CONSTRAINT fk_commits_on_repository_id")2528 -> 0.0013s2529-- execute("ALTER TABLE commits VALIDATE CONSTRAINT fk_commits_on_branch_id")2530 -> 0.0017s2531-- execute("ALTER TABLE commits VALIDATE CONSTRAINT fk_commits_on_tag_id")2532 -> 0.0007s2533-- execute("ALTER TABLE crons VALIDATE CONSTRAINT fk_crons_on_branch_id")2534 -> 0.0011s2535-- execute("ALTER TABLE job_configs VALIDATE CONSTRAINT fk_job_configs_on_repository_id")2536 -> 0.0017s2537-- execute("ALTER TABLE build_configs VALIDATE CONSTRAINT fk_build_configs_on_repository_id")2538 -> 0.0011s2539-- execute("ALTER TABLE pull_requests VALIDATE CONSTRAINT fk_pull_requests_on_repository_id")2540 -> 0.0011s2541-- execute("ALTER TABLE ssl_keys VALIDATE CONSTRAINT fk_ssl_keys_on_repository_id")2542 -> 0.0013s2543-- execute("ALTER TABLE requests VALIDATE CONSTRAINT fk_requests_on_commit_id")2544 -> 0.0016s2545-- execute("ALTER TABLE requests VALIDATE CONSTRAINT fk_requests_on_pull_request_id")2546 -> 0.0011s2547-- execute("ALTER TABLE requests VALIDATE CONSTRAINT fk_requests_on_branch_id")2548 -> 0.0010s2549-- execute("ALTER TABLE requests VALIDATE CONSTRAINT fk_requests_on_tag_id")2550 -> 0.0013s2551-- execute("ALTER TABLE requests VALIDATE CONSTRAINT fk_requests_on_config_id")2552 -> 0.0011s2553-- execute("ALTER TABLE stages VALIDATE CONSTRAINT fk_stages_on_build_id")2554 -> 0.0014s2555== 20181116800001 ValidateConstraints: migrated (0.0463s) =====================2557== 20181126080000 AddIndexesForForeignKeys: migrating =========================2558-- index_exists?(:builds, :branch_id)2559 -> 0.0138s2560-- add_index(:builds, :branch_id, {:algorithm=>:concurrently})2561 -> 0.0012s2562-- index_exists?(:builds, :commit_id)2563 -> 0.0132s2564-- add_index(:builds, :commit_id, {:algorithm=>:concurrently})2565 -> 0.0012s2566-- index_exists?(:builds, :pull_request_id)2567 -> 0.0132s2568-- add_index(:builds, :pull_request_id, {:algorithm=>:concurrently})2569 -> 0.0017s2570-- index_exists?(:builds, :tag_id)2571 -> 0.0162s2572-- add_index(:builds, :tag_id, {:algorithm=>:concurrently})2573 -> 0.0014s2574-- index_exists?(:jobs, :commit_id)2575 -> 0.0129s2576-- add_index(:jobs, :commit_id, {:algorithm=>:concurrently})2577 -> 0.0017s2578-- index_exists?(:branches, :last_build_id)2579 -> 0.0045s2580-- add_index(:branches, :last_build_id, {:algorithm=>:concurrently})2581 -> 0.0017s2582-- index_exists?(:tags, :repository_id)2583 -> 0.0035s2584-- add_index(:tags, :repository_id, {:algorithm=>:concurrently})2585 -> 0.0015s2586-- index_exists?(:tags, :last_build_id)2587 -> 0.0047s2588-- add_index(:tags, :last_build_id, {:algorithm=>:concurrently})2589 -> 0.0012s2590-- index_exists?(:commits, :tag_id)2591 -> 0.0051s2592-- add_index(:commits, :tag_id, {:algorithm=>:concurrently})2593 -> 0.0013s2594-- index_exists?(:commits, :branch_id)2595 -> 0.0058s2596-- add_index(:commits, :branch_id, {:algorithm=>:concurrently})2597 -> 0.0026s2598-- index_exists?(:job_configs, :repository_id)2599 -> 0.0031s2600-- add_index(:job_configs, :repository_id, {:algorithm=>:concurrently})2601 -> 0.0013s2602-- index_exists?(:build_configs, :repository_id)2603 -> 0.0022s2604-- add_index(:build_configs, :repository_id, {:algorithm=>:concurrently})2605 -> 0.0012s2606-- index_exists?(:pull_requests, :repository_id)2607 -> 0.0037s2608-- add_index(:pull_requests, :repository_id, {:algorithm=>:concurrently})2609 -> 0.0014s2610-- index_exists?(:requests, :pull_request_id)2611 -> 0.0084s2612-- add_index(:requests, :pull_request_id, {:algorithm=>:concurrently})2613 -> 0.0014s2614-- index_exists?(:requests, :tag_id)2615 -> 0.0052s2616-- add_index(:requests, :tag_id, {:algorithm=>:concurrently})2617 -> 0.0009s2618-- index_exists?(:requests, :branch_id)2619 -> 0.0060s2620-- add_index(:requests, :branch_id, {:algorithm=>:concurrently})2621 -> 0.0011s2622-- index_exists?(:repositories, :current_build_id)2623 -> 0.0064s2624-- add_index(:repositories, :current_build_id, {:algorithm=>:concurrently})2625 -> 0.0017s2626-- index_exists?(:repositories, :last_build_id)2627 -> 0.0101s2628-- add_index(:repositories, :last_build_id, {:algorithm=>:concurrently})2629 -> 0.0011s2630-- index_exists?(:crons, :branch_id)2631 -> 0.0047s2632-- add_index(:crons, :branch_id, {:algorithm=>:concurrently})2633 -> 0.0008s2634== 20181126080000 AddIndexesForForeignKeys: migrated (0.1756s) ================2636== 20181128120000 AddUniqueIndexToBranchesOnRepositoryIdAndName: migrating ====2637-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_branches_on_repository_id_and_name ON branches(repository_id, name)")2638 -> 0.0046s2639== 20181128120000 AddUniqueIndexToBranchesOnRepositoryIdAndName: migrated (0.0046s)2641== 20181203075818 AddUniqueNameColumnToBranches: migrating ====================2642-- add_column(:branches, :unique_name, :text)2643 -> 0.0008s2644== 20181203075818 AddUniqueNameColumnToBranches: migrated (0.0009s) ===========2646== 20181203075819 AddSetUniqueNameTriggerToBranches: migrating ================2647-- execute("DROP TRIGGER IF EXISTS set_unique_name_on_branches ON branches;\nDROP FUNCTION IF EXISTS set_unique_name();\nCREATE FUNCTION set_unique_name() RETURNS trigger AS $$\nDECLARE\n disable boolean;\nBEGIN\n disable := 'f';\n IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN\n BEGIN\n disable := current_setting('set_unique_name_on_branches.disable');\n EXCEPTION\n WHEN others THEN\n set set_unique_name_on_branches.disable = 'f';\n END;\n\n IF NOT disable THEN\n NEW.unique_name := NEW.name;\n END IF;\n END IF;\n RETURN NEW;\nEND;\n$$ LANGUAGE plpgsql;\n\nCREATE TRIGGER set_unique_name_on_branches\nBEFORE INSERT OR UPDATE ON branches\nFOR EACH ROW\nEXECUTE PROCEDURE set_unique_name();\n")2648 -> 0.0011s2649== 20181203075819 AddSetUniqueNameTriggerToBranches: migrated (0.0013s) =======2651== 20181203080356 CreateIndexOnBranchesUniqueNameAndRepositoryId: migrating ===2652-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_branches_repository_id_unique_name ON branches(repository_id, unique_name) WHERE unique_name IS NOT NULL")2653 -> 0.0010s2654== 20181203080356 CreateIndexOnBranchesUniqueNameAndRepositoryId: migrated (0.0010s)2656== 20181205152712 AddUniqueIndexToCronsOnBranchId: migrating ==================2657-- execute("DROP INDEX CONCURRENTLY index_crons_on_branch_id")2658 -> 0.0007s2659-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_crons_on_branch_id ON crons(branch_id)")2660 -> 0.0008s2661== 20181205152712 AddUniqueIndexToCronsOnBranchId: migrated (0.0016s) =========2663== 20190102000000 AddOrganizationPreferences: migrating =======================2664-- change_table(:organizations)2665 -> 0.0012s2666== 20190102000000 AddOrganizationPreferences: migrated (0.0012s) ==============2668== 20190102000001 ChangeOrganizationPreferencesDefault: migrating =============2669-- change_column_default(:organizations, :preferences, {})2670 -> 0.0032s2671== 20190102000001 ChangeOrganizationPreferencesDefault: migrated (0.0033s) ====2673== 20190109000000 CreateBetaMigrationRequestTable: migrating ==================2674-- create_table(:beta_migration_requests, {:id=>:integer})2675 -> 0.0031s2676-- add_index(:beta_migration_requests, [:owner_type, :owner_id])2677 -> 0.0008s2678== 20190109000000 CreateBetaMigrationRequestTable: migrated (0.0041s) =========2680== 20190118000000 AddBetaMigrationRequestColumnToOrganizations: migrating =====2681-- add_column(:organizations, :beta_migration_request_id, :integer)2682 -> 0.0008s2683== 20190118000000 AddBetaMigrationRequestColumnToOrganizations: migrated (0.0009s)2685== 20190204000000 MakeSubscriptionOwnerNotNullable: migrating =================2686-- change_column_null(:subscriptions, :owner_type, false)2687 -> 0.0006s2688-- change_column_null(:subscriptions, :owner_id, false)2689 -> 0.0003s2690== 20190204000000 MakeSubscriptionOwnerNotNullable: migrated (0.0011s) ========2692== 20190313000000 RequestRawConfigsCreate: migrating ==========================2693-- create_table(:request_raw_configs, {:id=>:integer})2694 -> 0.0027s2695-- add_index(:request_raw_configs, [:repository_id, :key])2696 -> 0.0009s2697-- create_table(:request_raw_configurations, {:id=>:integer})2698 -> 0.0028s2699-- add_index(:request_raw_configurations, :request_id)2700 -> 0.0007s2701-- add_index(:request_raw_configurations, :request_raw_config_id)2702 -> 0.0007s2703== 20190313000000 RequestRawConfigsCreate: migrated (0.0080s) =================2705== 20190329093854 CreateGatekeeperWorkers: migrating ==========================2706-- create_table(:gatekeeper_workers)2707 -> 0.0023s2708-- execute("INSERT INTO gatekeeper_workers(id) SELECT generate_series(1,200) as id;")2709 -> 0.0011s2710== 20190329093854 CreateGatekeeperWorkers: migrated (0.0034s) =================2712== 20190409133118 AddUniqueNumberColumnToBuilds: migrating ====================2713-- add_column(:builds, :unique_number, :int)2714 -> 0.0010s2715== 20190409133118 AddUniqueNumberColumnToBuilds: migrated (0.0010s) ===========2717== 20190409133320 AddSetUniqueNumberTriggerToBuilds: migrating ================2718-- execute("DROP TRIGGER IF EXISTS set_unique_number_on_builds ON builds;\nDROP FUNCTION IF EXISTS set_unique_number();\nCREATE FUNCTION set_unique_number() RETURNS trigger AS $$\nDECLARE\n disable boolean;\nBEGIN\n disable := 'f';\n IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN\n BEGIN\n disable := current_setting('set_unique_number_on_builds.disable');\n EXCEPTION\n WHEN others THEN\n set set_unique_number_on_builds.disable = 'f';\n END;\n\n IF NOT disable THEN\n IF NEW.unique_number IS NULL OR NEW.unique_number > 0 THEN\n NEW.unique_number := NEW.number;\n END IF;\n END IF;\n END IF;\n RETURN NEW;\nEND;\n$$ LANGUAGE plpgsql;\n\nCREATE TRIGGER set_unique_number_on_builds\nBEFORE INSERT OR UPDATE ON builds\nFOR EACH ROW\nEXECUTE PROCEDURE set_unique_number();\n")2719 -> 0.0011s2720== 20190409133320 AddSetUniqueNumberTriggerToBuilds: migrated (0.0013s) =======2722== 20190409133444 CreateUniqueIndexOnRepositoryIdAndNumberOnBuilds: migrating =2723-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_builds_repository_id_unique_number ON builds(repository_id, unique_number) WHERE unique_number IS NOT NULL")2724 -> 0.0012s2725== 20190409133444 CreateUniqueIndexOnRepositoryIdAndNumberOnBuilds: migrated (0.0012s)2727== 20190410121039 MakeSetUniqueNumberTriggerRunOnlyOnInsert: migrating ========2728-- execute(" DROP TRIGGER set_unique_number_on_builds ON builds;\n CREATE TRIGGER set_unique_number_on_builds\n BEFORE INSERT ON builds\n FOR EACH ROW\n EXECUTE PROCEDURE set_unique_number();\n")2729 -> 0.0008s2730== 20190410121039 MakeSetUniqueNumberTriggerRunOnlyOnInsert: migrated (0.0009s)2732== 20190416071629 RemoveUniqueNameFromBranches: migrating =====================2733-- execute("drop index concurrently index_branches_repository_id_unique_name;")2734 -> 0.0008s2735-- execute("DROP TRIGGER IF EXISTS set_unique_name_on_branches ON branches;\nDROP FUNCTION IF EXISTS set_unique_name();\n\n")2736 -> 0.0005s2737-- remove_column(:branches, :unique_name)2738 -> 0.0005s2739== 20190416071629 RemoveUniqueNameFromBranches: migrated (0.0020s) ============2741== 20190417072423 AlterBuildsUniqueNumberIndex: migrating =====================2742-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_builds_repository_id_unique_number_new ON builds(repository_id, unique_number) WHERE unique_number IS NOT NULL AND unique_number > 0")2743 -> 0.0013s2744-- execute("DROP INDEX CONCURRENTLY index_builds_repository_id_unique_number")2745 -> 0.0009s2746-- execute("ALTER INDEX index_builds_repository_id_unique_number_new RENAME TO index_builds_repository_id_unique_number")2747 -> 0.0004s2748== 20190417072423 AlterBuildsUniqueNumberIndex: migrated (0.0026s) ============2750== 20190417072838 ReinstallSetUniqueNumberTrigger: migrating ==================2751-- execute("DROP TRIGGER IF EXISTS set_unique_number_on_builds ON builds;\nDROP FUNCTION IF EXISTS set_unique_number();\n")2752 -> 0.0007s2753-- execute("DROP TRIGGER IF EXISTS set_unique_number_on_builds ON builds;\nDROP FUNCTION IF EXISTS set_unique_number();\nCREATE FUNCTION set_unique_number() RETURNS trigger AS $$\nDECLARE\n disable boolean;\nBEGIN\n disable := 'f';\n IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN\n BEGIN\n disable := current_setting('set_unique_number_on_builds.disable');\n EXCEPTION\n WHEN others THEN\n set set_unique_number_on_builds.disable = 'f';\n END;\n\n IF NOT disable THEN\n IF NEW.unique_number IS NULL OR NEW.unique_number > 0 THEN\n NEW.unique_number := NEW.number;\n END IF;\n END IF;\n END IF;\n RETURN NEW;\nEND;\n$$ LANGUAGE plpgsql;\n\nCREATE TRIGGER set_unique_number_on_builds\nBEFORE INSERT OR UPDATE ON builds\nFOR EACH ROW\nEXECUTE PROCEDURE set_unique_number();\n")2754 -> 0.0008s2755== 20190417072838 ReinstallSetUniqueNumberTrigger: migrated (0.0018s) =========2757== 20190502175059 AddMergeableStateToPullRequests: migrating ==================2758-- add_column(:pull_requests, :mergeable_state, :string)2759 -> 0.0009s2760== 20190502175059 AddMergeableStateToPullRequests: migrated (0.0009s) =========2762== 20190510121000 AddReposIndexOnLowerOwnerNameAndName: migrating =============2763-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_repositories_on_lower_owner_name_and_name ON repositories (LOWER(owner_name), LOWER(name)) WHERE invalidated_at IS NULL")2764 -> 0.0012s2765== 20190510121000 AddReposIndexOnLowerOwnerNameAndName: migrated (0.0012s) ====2767== 20190605121000 AddHistoryMigrationStatusToRepositories: migrating ==========2768-- add_column(:repositories, :history_migration_status, :string)2769 -> 0.0011s2770== 20190605121000 AddHistoryMigrationStatusToRepositories: migrated (0.0012s) =2772== 20190605155459 AddPullRequestMergeableToRequests: migrating ================2773-- add_column(:requests, :pull_request_mergeable, :string)2774 -> 0.0008s2775== 20190605155459 AddPullRequestMergeableToRequests: migrated (0.0009s) =======2777== 20190613120000 SoftDeleteRepositoryAlongWithItsData: migrating =============2778-- execute("create table if not exists deleted_builds (like builds)")2779 -> 0.0021s2780-- execute("create table if not exists deleted_stages (like stages)")2781 -> 0.0014s2782-- execute("create table if not exists deleted_jobs (like jobs)")2783 -> 0.0017s2784-- execute("create table if not exists deleted_requests (like requests)")2785 -> 0.0017s2786-- execute("create table if not exists deleted_commits (like commits)")2787 -> 0.0016s2788-- execute("create table if not exists deleted_pull_requests (like pull_requests)")2789 -> 0.0015s2790-- execute("create table if not exists deleted_job_configs (like job_configs)")2791 -> 0.0016s2792-- execute("create table if not exists deleted_build_configs (like build_configs)")2793 -> 0.0017s2794-- execute("create table if not exists deleted_request_configs (like request_configs)")2795 -> 0.0017s2796-- execute("create table if not exists deleted_request_payloads (like request_payloads)")2797 -> 0.0018s2798-- execute("create table if not exists deleted_ssl_keys (like ssl_keys)")2799 -> 0.0020s2800-- execute("create table if not exists deleted_tags (like tags)")2801 -> 0.0014s2802-- execute("DROP FUNCTION IF EXISTS soft_delete_repo_data(bigint);\nCREATE FUNCTION soft_delete_repo_data(r_id bigint) RETURNS void AS $$\nDECLARE\n request_raw_config_ids bigint[];\n request_raw_configuration_ids bigint[];\n request_yaml_config_ids bigint[];\n request_config_ids bigint[];\n tag_ids bigint[];\n ssl_key_ids bigint[];\n build_config_ids bigint[];\n job_config_ids bigint[];\n build_ids bigint[];\n pull_request_ids bigint[];\n commit_ids bigint[];\n request_ids bigint[];\n request_payload_ids bigint[];\n stage_ids bigint[];\n job_ids bigint[];\nBEGIN\n SELECT INTO job_ids array_agg(id) FROM jobs WHERE repository_id = r_id;\n SELECT INTO stage_ids array_agg(id) FROM stages WHERE build_id IN (SELECT id FROM builds WHERE repository_id = r_id);\n SELECT INTO request_payload_ids array_agg(id) FROM request_payloads WHERE request_id IN (SELECT id FROM requests WHERE repository_id = r_id);\n SELECT INTO request_ids array_agg(id) FROM requests WHERE repository_id = r_id;\n SELECT INTO commit_ids array_agg(id) FROM commits WHERE repository_id = r_id;\n SELECT INTO pull_request_ids array_agg(id) FROM pull_requests WHERE repository_id = r_id;\n SELECT INTO build_ids array_agg(id) FROM builds WHERE repository_id = r_id;\n SELECT INTO job_config_ids array_agg(id) FROM job_configs WHERE repository_id = r_id;\n SELECT INTO build_config_ids array_agg(id) FROM build_configs WHERE repository_id = r_id;\n SELECT INTO ssl_key_ids array_agg(id) FROM ssl_keys WHERE repository_id = r_id;\n SELECT INTO tag_ids array_agg(id) FROM tags WHERE repository_id = r_id;\n SELECT INTO request_config_ids array_agg(id) FROM request_configs WHERE repository_id = r_id;\n SELECT INTO request_yaml_config_ids array_agg(id) FROM request_yaml_configs WHERE repository_id = r_id;\n SELECT INTO request_raw_configuration_ids array_agg(id) FROM request_raw_configurations WHERE request_id = ANY(request_ids);\n SELECT INTO request_raw_config_ids array_agg(id) FROM request_raw_configs WHERE id IN (SELECT request_raw_config_id FROM request_raw_configurations WHERE request_id = ANY(request_ids));\n\n INSERT INTO deleted_jobs SELECT * FROM jobs WHERE id = ANY(job_ids);\n INSERT INTO deleted_stages SELECT * FROM stages WHERE id = ANY(stage_ids);\n INSERT INTO deleted_request_payloads SELECT * FROM request_payloads WHERE id = ANY(request_payload_ids);\n INSERT INTO deleted_requests SELECT * FROM requests WHERE id = ANY(request_ids);\n INSERT INTO deleted_commits SELECT * FROM commits WHERE id = ANY(commit_ids);\n INSERT INTO deleted_pull_requests SELECT * FROM pull_requests WHERE id = ANY(pull_request_ids);\n INSERT INTO deleted_builds SELECT * FROM builds WHERE id = ANY(build_ids);\n INSERT INTO deleted_job_configs SELECT * FROM job_configs WHERE id = ANY(job_config_ids);\n INSERT INTO deleted_build_configs SELECT * FROM build_configs WHERE id = ANY(build_config_ids);\n INSERT INTO deleted_ssl_keys SELECT * FROM ssl_keys WHERE id = ANY(ssl_key_ids);\n INSERT INTO deleted_tags SELECT * FROM tags WHERE id = ANY(tag_ids);\n INSERT INTO deleted_request_configs SELECT * FROM request_configs WHERE id = ANY(request_config_ids);\n INSERT INTO deleted_request_yaml_configs SELECT * FROM request_yaml_configs WHERE id = ANY(request_yaml_config_ids);\n INSERT INTO deleted_request_raw_configurations SELECT * FROM request_raw_configurations WHERE id = ANY(request_raw_configuration_ids);\n INSERT INTO deleted_request_raw_configs SELECT * FROM request_raw_configs WHERE id = ANY(request_raw_config_ids);\n\n DELETE FROM jobs WHERE id = ANY(job_ids);\n DELETE FROM stages WHERE id = ANY(stage_ids);\n DELETE FROM request_payloads WHERE id = ANY(request_payload_ids);\n DELETE FROM requests WHERE id = ANY(request_ids);\n DELETE FROM commits WHERE id = ANY(commit_ids);\n DELETE FROM pull_requests WHERE id = ANY(pull_request_ids);\n DELETE FROM builds WHERE id = ANY(build_ids);\n DELETE FROM job_configs WHERE id = ANY(job_config_ids);\n DELETE FROM build_configs WHERE id = ANY(build_config_ids);\n DELETE FROM ssl_keys WHERE id = ANY(ssl_key_ids);\n DELETE FROM tags WHERE id = ANY(tag_ids);\n DELETE FROM request_configs WHERE id = ANY(request_config_ids);\n DELETE FROM request_yaml_configs WHERE id = ANY(request_yaml_config_ids);\n DELETE FROM request_raw_configurations WHERE id = ANY(request_raw_configuration_ids);\n DELETE FROM request_raw_configs WHERE id = ANY(request_raw_config_ids);\nEND;\n$$ LANGUAGE plpgsql;\n")2803 -> 0.0018s2804== 20190613120000 SoftDeleteRepositoryAlongWithItsData: migrated (0.0226s) ====2806== 20190618082559 AddVcsTypeToUser: migrating =================================2807-- add_column(:users, :vcs_type, :string, {:default=>nil})2808 -> 0.0014s2809-- execute("ALTER TABLE users ALTER COLUMN vcs_type SET DEFAULT 'GithubUser'")2810 -> 0.0005s2811-- select_value("SELECT id FROM users ORDER BY id DESC LIMIT 1")2812 -> 0.0012s2813-- execute("UPDATE users SET vcs_type = 'GithubUser' WHERE id BETWEEN 0 AND 5000")2814 -> 0.0007s2815== 20190618082559 AddVcsTypeToUser: migrated (0.0046s) ========================2817== 20190701082559 AddVcsTypeToRepository: migrating ===========================2818-- add_column(:repositories, :vcs_type, :string, {:default=>nil})2819 -> 0.0011s2820-- execute("ALTER TABLE repositories ALTER COLUMN vcs_type SET DEFAULT 'GithubRepository'")2821 -> 0.0008s2822-- select_value("SELECT id FROM repositories ORDER BY id DESC LIMIT 1")2823 -> 0.0010s2824-- execute("UPDATE repositories SET vcs_type = 'GithubRepository' WHERE id BETWEEN 0 AND 5000")2825 -> 0.0007s2826== 20190701082559 AddVcsTypeToRepository: migrated (0.0045s) ==================2828== 20190704082559 AddVcsTypeToOrganization: migrating =========================2829-- add_column(:organizations, :vcs_type, :string, {:default=>nil})2830 -> 0.0011s2831-- execute("ALTER TABLE organizations ALTER COLUMN vcs_type SET DEFAULT 'GithubOrganization'")2832 -> 0.0005s2833-- select_value("SELECT id FROM organizations ORDER BY id DESC LIMIT 1")2834 -> 0.0008s2835-- execute("UPDATE organizations SET vcs_type = 'GithubOrganization' WHERE id BETWEEN 0 AND 5000")2836 -> 0.0006s2837== 20190704082559 AddVcsTypeToOrganization: migrated (0.0038s) ================2839== 20190718092750 AddDeleteCascadeToForeignKeys: migrating ====================2840-- execute("ALTER TABLE builds ADD CONSTRAINT fk_new_builds_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) ON DELETE CASCADE NOT VALID")2841 -> 0.0013s2842-- execute("ALTER TABLE builds ADD CONSTRAINT fk_new_builds_on_commit_id FOREIGN KEY (commit_id) REFERENCES commits(id) ON DELETE CASCADE NOT VALID")2843 -> 0.0009s2844-- execute("ALTER TABLE builds ADD CONSTRAINT fk_new_builds_on_request_id FOREIGN KEY (request_id) REFERENCES requests(id) ON DELETE CASCADE NOT VALID")2845 -> 0.0009s2846-- execute("ALTER TABLE builds ADD CONSTRAINT fk_new_builds_on_pull_request_id FOREIGN KEY (pull_request_id) REFERENCES pull_requests(id) ON DELETE CASCADE NOT VALID")2847 -> 0.0010s2848-- execute("ALTER TABLE builds ADD CONSTRAINT fk_new_builds_on_branch_id FOREIGN KEY (branch_id) REFERENCES branches(id) ON DELETE CASCADE NOT VALID")2849 -> 0.0009s2850-- execute("ALTER TABLE builds ADD CONSTRAINT fk_new_builds_on_tag_id FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE NOT VALID")2851 -> 0.0010s2852-- execute("ALTER TABLE builds ADD CONSTRAINT fk_new_builds_on_config_id FOREIGN KEY (config_id) REFERENCES build_configs(id) ON DELETE CASCADE NOT VALID")2853 -> 0.0009s2854-- execute("ALTER TABLE jobs ADD CONSTRAINT fk_new_jobs_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) ON DELETE CASCADE NOT VALID")2855 -> 0.0010s2856-- execute("ALTER TABLE jobs ADD CONSTRAINT fk_new_jobs_on_commit_id FOREIGN KEY (commit_id) REFERENCES commits(id) ON DELETE CASCADE NOT VALID")2857 -> 0.0009s2858-- execute("ALTER TABLE jobs ADD CONSTRAINT fk_new_jobs_on_stage_id FOREIGN KEY (stage_id) REFERENCES stages(id) ON DELETE CASCADE NOT VALID")2859 -> 0.0008s2860-- execute("ALTER TABLE jobs ADD CONSTRAINT fk_new_jobs_on_config_id FOREIGN KEY (config_id) REFERENCES job_configs(id) ON DELETE CASCADE NOT VALID")2861 -> 0.0009s2862-- execute("ALTER TABLE branches ADD CONSTRAINT fk_new_branches_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) ON DELETE CASCADE NOT VALID")2863 -> 0.0009s2864-- execute("ALTER TABLE tags ADD CONSTRAINT fk_new_tags_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) ON DELETE CASCADE NOT VALID")2865 -> 0.0009s2866-- execute("ALTER TABLE commits ADD CONSTRAINT fk_new_commits_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) ON DELETE CASCADE NOT VALID")2867 -> 0.0009s2868-- execute("ALTER TABLE commits ADD CONSTRAINT fk_new_commits_on_branch_id FOREIGN KEY (branch_id) REFERENCES branches(id) ON DELETE CASCADE NOT VALID")2869 -> 0.0008s2870-- execute("ALTER TABLE commits ADD CONSTRAINT fk_new_commits_on_tag_id FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE NOT VALID")2871 -> 0.0008s2872-- execute("ALTER TABLE crons ADD CONSTRAINT fk_new_crons_on_branch_id FOREIGN KEY (branch_id) REFERENCES branches(id) ON DELETE CASCADE NOT VALID")2873 -> 0.0008s2874-- execute("ALTER TABLE job_configs ADD CONSTRAINT fk_new_job_configs_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) ON DELETE CASCADE NOT VALID")2875 -> 0.0009s2876-- execute("ALTER TABLE build_configs ADD CONSTRAINT fk_new_build_configs_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) ON DELETE CASCADE NOT VALID")2877 -> 0.0009s2878-- execute("ALTER TABLE pull_requests ADD CONSTRAINT fk_new_pull_requests_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) ON DELETE CASCADE NOT VALID")2879 -> 0.0008s2880-- execute("ALTER TABLE ssl_keys ADD CONSTRAINT fk_new_ssl_keys_on_repository_id FOREIGN KEY (repository_id) REFERENCES repositories(id) ON DELETE CASCADE NOT VALID")2881 -> 0.0009s2882-- execute("ALTER TABLE requests ADD CONSTRAINT fk_new_requests_on_commit_id FOREIGN KEY (commit_id) REFERENCES commits(id) ON DELETE CASCADE NOT VALID")2883 -> 0.0009s2884-- execute("ALTER TABLE requests ADD CONSTRAINT fk_new_requests_on_pull_request_id FOREIGN KEY (pull_request_id) REFERENCES pull_requests(id) ON DELETE CASCADE NOT VALID")2885 -> 0.0010s2886-- execute("ALTER TABLE requests ADD CONSTRAINT fk_new_requests_on_branch_id FOREIGN KEY (branch_id) REFERENCES branches(id) ON DELETE CASCADE NOT VALID")2887 -> 0.0014s2888-- execute("ALTER TABLE requests ADD CONSTRAINT fk_new_requests_on_tag_id FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE NOT VALID")2889 -> 0.0009s2890-- execute("ALTER TABLE requests ADD CONSTRAINT fk_new_requests_on_config_id FOREIGN KEY (config_id) REFERENCES request_configs(id) ON DELETE CASCADE NOT VALID")2891 -> 0.0010s2892-- execute("ALTER TABLE stages ADD CONSTRAINT fk_new_stages_on_build_id FOREIGN KEY (build_id) REFERENCES builds(id) ON DELETE CASCADE NOT VALID")2893 -> 0.0009s2894-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_new_builds_on_repository_id")2895 -> 0.0022s2896-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_new_builds_on_commit_id")2897 -> 0.0011s2898-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_new_builds_on_request_id")2899 -> 0.0011s2900-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_new_builds_on_pull_request_id")2901 -> 0.0010s2902-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_new_builds_on_branch_id")2903 -> 0.0010s2904-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_new_builds_on_tag_id")2905 -> 0.0010s2906-- execute("ALTER TABLE builds VALIDATE CONSTRAINT fk_new_builds_on_config_id")2907 -> 0.0009s2908-- execute("ALTER TABLE jobs VALIDATE CONSTRAINT fk_new_jobs_on_repository_id")2909 -> 0.0011s2910-- execute("ALTER TABLE jobs VALIDATE CONSTRAINT fk_new_jobs_on_commit_id")2911 -> 0.0011s2912-- execute("ALTER TABLE jobs VALIDATE CONSTRAINT fk_new_jobs_on_stage_id")2913 -> 0.0010s2914-- execute("ALTER TABLE jobs VALIDATE CONSTRAINT fk_new_jobs_on_config_id")2915 -> 0.0012s2916-- execute("ALTER TABLE branches VALIDATE CONSTRAINT fk_new_branches_on_repository_id")2917 -> 0.0011s2918-- execute("ALTER TABLE tags VALIDATE CONSTRAINT fk_new_tags_on_repository_id")2919 -> 0.0010s2920-- execute("ALTER TABLE commits VALIDATE CONSTRAINT fk_new_commits_on_repository_id")2921 -> 0.0011s2922-- execute("ALTER TABLE commits VALIDATE CONSTRAINT fk_new_commits_on_branch_id")2923 -> 0.0009s2924-- execute("ALTER TABLE commits VALIDATE CONSTRAINT fk_new_commits_on_tag_id")2925 -> 0.0007s2926-- execute("ALTER TABLE crons VALIDATE CONSTRAINT fk_new_crons_on_branch_id")2927 -> 0.0008s2928-- execute("ALTER TABLE job_configs VALIDATE CONSTRAINT fk_new_job_configs_on_repository_id")2929 -> 0.0007s2930-- execute("ALTER TABLE build_configs VALIDATE CONSTRAINT fk_new_build_configs_on_repository_id")2931 -> 0.0007s2932-- execute("ALTER TABLE pull_requests VALIDATE CONSTRAINT fk_new_pull_requests_on_repository_id")2933 -> 0.0008s2934-- execute("ALTER TABLE ssl_keys VALIDATE CONSTRAINT fk_new_ssl_keys_on_repository_id")2935 -> 0.0008s2936-- execute("ALTER TABLE requests VALIDATE CONSTRAINT fk_new_requests_on_commit_id")2937 -> 0.0011s2938-- execute("ALTER TABLE requests VALIDATE CONSTRAINT fk_new_requests_on_pull_request_id")2939 -> 0.0007s2940-- execute("ALTER TABLE requests VALIDATE CONSTRAINT fk_new_requests_on_branch_id")2941 -> 0.0008s2942-- execute("ALTER TABLE requests VALIDATE CONSTRAINT fk_new_requests_on_tag_id")2943 -> 0.0007s2944-- execute("ALTER TABLE requests VALIDATE CONSTRAINT fk_new_requests_on_config_id")2945 -> 0.0007s2946-- execute("ALTER TABLE stages VALIDATE CONSTRAINT fk_new_stages_on_build_id")2947 -> 0.0008s2948-- execute("ALTER TABLE builds DROP CONSTRAINT fk_builds_on_repository_id")2949 -> 0.0010s2950-- execute("ALTER TABLE builds DROP CONSTRAINT fk_builds_on_commit_id")2951 -> 0.0008s2952-- execute("ALTER TABLE builds DROP CONSTRAINT fk_builds_on_request_id")2953 -> 0.0008s2954-- execute("ALTER TABLE builds DROP CONSTRAINT fk_builds_on_pull_request_id")2955 -> 0.0010s2956-- execute("ALTER TABLE builds DROP CONSTRAINT fk_builds_on_branch_id")2957 -> 0.0008s2958-- execute("ALTER TABLE builds DROP CONSTRAINT fk_builds_on_tag_id")2959 -> 0.0008s2960-- execute("ALTER TABLE builds DROP CONSTRAINT fk_builds_on_config_id")2961 -> 0.0008s2962-- execute("ALTER TABLE jobs DROP CONSTRAINT fk_jobs_on_repository_id")2963 -> 0.0008s2964-- execute("ALTER TABLE jobs DROP CONSTRAINT fk_jobs_on_commit_id")2965 -> 0.0008s2966-- execute("ALTER TABLE jobs DROP CONSTRAINT fk_jobs_on_stage_id")2967 -> 0.0007s2968-- execute("ALTER TABLE jobs DROP CONSTRAINT fk_jobs_on_config_id")2969 -> 0.0007s2970-- execute("ALTER TABLE branches DROP CONSTRAINT fk_branches_on_repository_id")2971 -> 0.0009s2972-- execute("ALTER TABLE tags DROP CONSTRAINT fk_tags_on_repository_id")2973 -> 0.0009s2974-- execute("ALTER TABLE commits DROP CONSTRAINT fk_commits_on_repository_id")2975 -> 0.0008s2976-- execute("ALTER TABLE commits DROP CONSTRAINT fk_commits_on_branch_id")2977 -> 0.0007s2978-- execute("ALTER TABLE commits DROP CONSTRAINT fk_commits_on_tag_id")2979 -> 0.0007s2980-- execute("ALTER TABLE crons DROP CONSTRAINT fk_crons_on_branch_id")2981 -> 0.0008s2982-- execute("ALTER TABLE job_configs DROP CONSTRAINT fk_job_configs_on_repository_id")2983 -> 0.0007s2984-- execute("ALTER TABLE build_configs DROP CONSTRAINT fk_build_configs_on_repository_id")2985 -> 0.0007s2986-- execute("ALTER TABLE pull_requests DROP CONSTRAINT fk_pull_requests_on_repository_id")2987 -> 0.0008s2988-- execute("ALTER TABLE ssl_keys DROP CONSTRAINT fk_ssl_keys_on_repository_id")2989 -> 0.0008s2990-- execute("ALTER TABLE requests DROP CONSTRAINT fk_requests_on_commit_id")2991 -> 0.0008s2992-- execute("ALTER TABLE requests DROP CONSTRAINT fk_requests_on_pull_request_id")2993 -> 0.0007s2994-- execute("ALTER TABLE requests DROP CONSTRAINT fk_requests_on_branch_id")2995 -> 0.0008s2996-- execute("ALTER TABLE requests DROP CONSTRAINT fk_requests_on_tag_id")2997 -> 0.0008s2998-- execute("ALTER TABLE requests DROP CONSTRAINT fk_requests_on_config_id")2999 -> 0.0008s3000-- execute("ALTER TABLE stages DROP CONSTRAINT fk_stages_on_build_id")3001 -> 0.0007s3002-- execute("ALTER TABLE builds RENAME CONSTRAINT fk_new_builds_on_repository_id TO fk_builds_on_repository_id")3003 -> 0.0005s3004-- execute("ALTER TABLE builds RENAME CONSTRAINT fk_new_builds_on_commit_id TO fk_builds_on_commit_id")3005 -> 0.0004s3006-- execute("ALTER TABLE builds RENAME CONSTRAINT fk_new_builds_on_request_id TO fk_builds_on_request_id")3007 -> 0.0004s3008-- execute("ALTER TABLE builds RENAME CONSTRAINT fk_new_builds_on_pull_request_id TO fk_builds_on_pull_request_id")3009 -> 0.0004s3010-- execute("ALTER TABLE builds RENAME CONSTRAINT fk_new_builds_on_branch_id TO fk_builds_on_branch_id")3011 -> 0.0004s3012-- execute("ALTER TABLE builds RENAME CONSTRAINT fk_new_builds_on_tag_id TO fk_builds_on_tag_id")3013 -> 0.0004s3014-- execute("ALTER TABLE builds RENAME CONSTRAINT fk_new_builds_on_config_id TO fk_builds_on_config_id")3015 -> 0.0004s3016-- execute("ALTER TABLE jobs RENAME CONSTRAINT fk_new_jobs_on_repository_id TO fk_jobs_on_repository_id")3017 -> 0.0003s3018-- execute("ALTER TABLE jobs RENAME CONSTRAINT fk_new_jobs_on_commit_id TO fk_jobs_on_commit_id")3019 -> 0.0004s3020-- execute("ALTER TABLE jobs RENAME CONSTRAINT fk_new_jobs_on_stage_id TO fk_jobs_on_stage_id")3021 -> 0.0004s3022-- execute("ALTER TABLE jobs RENAME CONSTRAINT fk_new_jobs_on_config_id TO fk_jobs_on_config_id")3023 -> 0.0003s3024-- execute("ALTER TABLE branches RENAME CONSTRAINT fk_new_branches_on_repository_id TO fk_branches_on_repository_id")3025 -> 0.0004s3026-- execute("ALTER TABLE tags RENAME CONSTRAINT fk_new_tags_on_repository_id TO fk_tags_on_repository_id")3027 -> 0.0004s3028-- execute("ALTER TABLE commits RENAME CONSTRAINT fk_new_commits_on_repository_id TO fk_commits_on_repository_id")3029 -> 0.0004s3030-- execute("ALTER TABLE commits RENAME CONSTRAINT fk_new_commits_on_branch_id TO fk_commits_on_branch_id")3031 -> 0.0003s3032-- execute("ALTER TABLE commits RENAME CONSTRAINT fk_new_commits_on_tag_id TO fk_commits_on_tag_id")3033 -> 0.0004s3034-- execute("ALTER TABLE crons RENAME CONSTRAINT fk_new_crons_on_branch_id TO fk_crons_on_branch_id")3035 -> 0.0003s3036-- execute("ALTER TABLE job_configs RENAME CONSTRAINT fk_new_job_configs_on_repository_id TO fk_job_configs_on_repository_id")3037 -> 0.0004s3038-- execute("ALTER TABLE build_configs RENAME CONSTRAINT fk_new_build_configs_on_repository_id TO fk_build_configs_on_repository_id")3039 -> 0.0003s3040-- execute("ALTER TABLE pull_requests RENAME CONSTRAINT fk_new_pull_requests_on_repository_id TO fk_pull_requests_on_repository_id")3041 -> 0.0004s3042-- execute("ALTER TABLE ssl_keys RENAME CONSTRAINT fk_new_ssl_keys_on_repository_id TO fk_ssl_keys_on_repository_id")3043 -> 0.0003s3044-- execute("ALTER TABLE requests RENAME CONSTRAINT fk_new_requests_on_commit_id TO fk_requests_on_commit_id")3045 -> 0.0003s3046-- execute("ALTER TABLE requests RENAME CONSTRAINT fk_new_requests_on_pull_request_id TO fk_requests_on_pull_request_id")3047 -> 0.0004s3048-- execute("ALTER TABLE requests RENAME CONSTRAINT fk_new_requests_on_branch_id TO fk_requests_on_branch_id")3049 -> 0.0004s3050-- execute("ALTER TABLE requests RENAME CONSTRAINT fk_new_requests_on_tag_id TO fk_requests_on_tag_id")3051 -> 0.0004s3052-- execute("ALTER TABLE requests RENAME CONSTRAINT fk_new_requests_on_config_id TO fk_requests_on_config_id")3053 -> 0.0004s3054-- execute("ALTER TABLE stages RENAME CONSTRAINT fk_new_stages_on_build_id TO fk_stages_on_build_id")3055 -> 0.0003s3056== 20190718092750 AddDeleteCascadeToForeignKeys: migrated (0.0863s) ===========3058== 20190718100426 UpdateSoftDeleteProcedure: migrating ========================3059-- execute("DROP FUNCTION IF EXISTS soft_delete_repo_data(bigint);\nCREATE FUNCTION soft_delete_repo_data(r_id bigint) RETURNS void AS $$\nDECLARE\n request_raw_config_ids bigint[];\n request_raw_configuration_ids bigint[];\n request_yaml_config_ids bigint[];\n request_config_ids bigint[];\n tag_ids bigint[];\n ssl_key_ids bigint[];\n build_config_ids bigint[];\n job_config_ids bigint[];\n build_ids bigint[];\n pull_request_ids bigint[];\n commit_ids bigint[];\n request_ids bigint[];\n request_payload_ids bigint[];\n stage_ids bigint[];\n job_ids bigint[];\nBEGIN\n SELECT INTO job_ids array_agg(id) FROM jobs WHERE repository_id = r_id;\n SELECT INTO stage_ids array_agg(id) FROM stages WHERE build_id IN (SELECT id FROM builds WHERE repository_id = r_id);\n SELECT INTO request_payload_ids array_agg(id) FROM request_payloads WHERE request_id IN (SELECT id FROM requests WHERE repository_id = r_id);\n SELECT INTO request_ids array_agg(id) FROM requests WHERE repository_id = r_id;\n SELECT INTO commit_ids array_agg(id) FROM commits WHERE repository_id = r_id;\n SELECT INTO pull_request_ids array_agg(id) FROM pull_requests WHERE repository_id = r_id;\n SELECT INTO build_ids array_agg(id) FROM builds WHERE repository_id = r_id;\n SELECT INTO job_config_ids array_agg(id) FROM job_configs WHERE repository_id = r_id;\n SELECT INTO build_config_ids array_agg(id) FROM build_configs WHERE repository_id = r_id;\n SELECT INTO ssl_key_ids array_agg(id) FROM ssl_keys WHERE repository_id = r_id;\n SELECT INTO tag_ids array_agg(id) FROM tags WHERE repository_id = r_id;\n SELECT INTO request_config_ids array_agg(id) FROM request_configs WHERE repository_id = r_id;\n SELECT INTO request_yaml_config_ids array_agg(id) FROM request_yaml_configs WHERE repository_id = r_id;\n SELECT INTO request_raw_configuration_ids array_agg(id) FROM request_raw_configurations WHERE request_id = ANY(request_ids);\n SELECT INTO request_raw_config_ids array_agg(id) FROM request_raw_configs WHERE id IN (SELECT request_raw_config_id FROM request_raw_configurations WHERE request_id = ANY(request_ids));\n\n INSERT INTO deleted_jobs SELECT * FROM jobs WHERE id = ANY(job_ids);\n INSERT INTO deleted_stages SELECT * FROM stages WHERE id = ANY(stage_ids);\n INSERT INTO deleted_request_payloads SELECT * FROM request_payloads WHERE id = ANY(request_payload_ids);\n INSERT INTO deleted_requests SELECT * FROM requests WHERE id = ANY(request_ids);\n INSERT INTO deleted_commits SELECT * FROM commits WHERE id = ANY(commit_ids);\n INSERT INTO deleted_pull_requests SELECT * FROM pull_requests WHERE id = ANY(pull_request_ids);\n INSERT INTO deleted_builds SELECT * FROM builds WHERE id = ANY(build_ids);\n INSERT INTO deleted_job_configs SELECT * FROM job_configs WHERE id = ANY(job_config_ids);\n INSERT INTO deleted_build_configs SELECT * FROM build_configs WHERE id = ANY(build_config_ids);\n INSERT INTO deleted_ssl_keys SELECT * FROM ssl_keys WHERE id = ANY(ssl_key_ids);\n INSERT INTO deleted_tags SELECT * FROM tags WHERE id = ANY(tag_ids);\n INSERT INTO deleted_request_configs SELECT * FROM request_configs WHERE id = ANY(request_config_ids);\n INSERT INTO deleted_request_yaml_configs SELECT * FROM request_yaml_configs WHERE id = ANY(request_yaml_config_ids);\n INSERT INTO deleted_request_raw_configurations SELECT * FROM request_raw_configurations WHERE id = ANY(request_raw_configuration_ids);\n INSERT INTO deleted_request_raw_configs SELECT * FROM request_raw_configs WHERE id = ANY(request_raw_config_ids);\n\n DELETE FROM jobs WHERE id = ANY(job_ids);\n DELETE FROM stages WHERE id = ANY(stage_ids);\n DELETE FROM request_payloads WHERE id = ANY(request_payload_ids);\n DELETE FROM requests WHERE id = ANY(request_ids);\n DELETE FROM commits WHERE id = ANY(commit_ids);\n DELETE FROM pull_requests WHERE id = ANY(pull_request_ids);\n DELETE FROM builds WHERE id = ANY(build_ids);\n DELETE FROM job_configs WHERE id = ANY(job_config_ids);\n DELETE FROM build_configs WHERE id = ANY(build_config_ids);\n DELETE FROM ssl_keys WHERE id = ANY(ssl_key_ids);\n DELETE FROM tags WHERE id = ANY(tag_ids);\n DELETE FROM request_configs WHERE id = ANY(request_config_ids);\n DELETE FROM request_yaml_configs WHERE id = ANY(request_yaml_config_ids);\n DELETE FROM request_raw_configurations WHERE id = ANY(request_raw_configuration_ids);\n DELETE FROM request_raw_configs WHERE id = ANY(request_raw_config_ids);\nEND;\n$$ LANGUAGE plpgsql;\n")3060 -> 0.0030s3061== 20190718100426 UpdateSoftDeleteProcedure: migrated (0.1668s) ===============3063== 20190725103113 UpdateSoftDelete: migrating =================================3064-- execute("create table deleted_request_yaml_configs (like request_yaml_configs)")3065 -> 0.0020s3066-- execute("DROP FUNCTION IF EXISTS soft_delete_repo_data(bigint);\nCREATE FUNCTION soft_delete_repo_data(r_id bigint) RETURNS void AS $$\nDECLARE\n request_raw_config_ids bigint[];\n request_raw_configuration_ids bigint[];\n request_yaml_config_ids bigint[];\n request_config_ids bigint[];\n tag_ids bigint[];\n ssl_key_ids bigint[];\n build_config_ids bigint[];\n job_config_ids bigint[];\n build_ids bigint[];\n pull_request_ids bigint[];\n commit_ids bigint[];\n request_ids bigint[];\n request_payload_ids bigint[];\n stage_ids bigint[];\n job_ids bigint[];\nBEGIN\n SELECT INTO job_ids array_agg(id) FROM jobs WHERE repository_id = r_id;\n SELECT INTO stage_ids array_agg(id) FROM stages WHERE build_id IN (SELECT id FROM builds WHERE repository_id = r_id);\n SELECT INTO request_payload_ids array_agg(id) FROM request_payloads WHERE request_id IN (SELECT id FROM requests WHERE repository_id = r_id);\n SELECT INTO request_ids array_agg(id) FROM requests WHERE repository_id = r_id;\n SELECT INTO commit_ids array_agg(id) FROM commits WHERE repository_id = r_id;\n SELECT INTO pull_request_ids array_agg(id) FROM pull_requests WHERE repository_id = r_id;\n SELECT INTO build_ids array_agg(id) FROM builds WHERE repository_id = r_id;\n SELECT INTO job_config_ids array_agg(id) FROM job_configs WHERE repository_id = r_id;\n SELECT INTO build_config_ids array_agg(id) FROM build_configs WHERE repository_id = r_id;\n SELECT INTO ssl_key_ids array_agg(id) FROM ssl_keys WHERE repository_id = r_id;\n SELECT INTO tag_ids array_agg(id) FROM tags WHERE repository_id = r_id;\n SELECT INTO request_config_ids array_agg(id) FROM request_configs WHERE repository_id = r_id;\n SELECT INTO request_yaml_config_ids array_agg(id) FROM request_yaml_configs WHERE repository_id = r_id;\n SELECT INTO request_raw_configuration_ids array_agg(id) FROM request_raw_configurations WHERE request_id = ANY(request_ids);\n SELECT INTO request_raw_config_ids array_agg(id) FROM request_raw_configs WHERE id IN (SELECT request_raw_config_id FROM request_raw_configurations WHERE request_id = ANY(request_ids));\n\n INSERT INTO deleted_jobs SELECT * FROM jobs WHERE id = ANY(job_ids);\n INSERT INTO deleted_stages SELECT * FROM stages WHERE id = ANY(stage_ids);\n INSERT INTO deleted_request_payloads SELECT * FROM request_payloads WHERE id = ANY(request_payload_ids);\n INSERT INTO deleted_requests SELECT * FROM requests WHERE id = ANY(request_ids);\n INSERT INTO deleted_commits SELECT * FROM commits WHERE id = ANY(commit_ids);\n INSERT INTO deleted_pull_requests SELECT * FROM pull_requests WHERE id = ANY(pull_request_ids);\n INSERT INTO deleted_builds SELECT * FROM builds WHERE id = ANY(build_ids);\n INSERT INTO deleted_job_configs SELECT * FROM job_configs WHERE id = ANY(job_config_ids);\n INSERT INTO deleted_build_configs SELECT * FROM build_configs WHERE id = ANY(build_config_ids);\n INSERT INTO deleted_ssl_keys SELECT * FROM ssl_keys WHERE id = ANY(ssl_key_ids);\n INSERT INTO deleted_tags SELECT * FROM tags WHERE id = ANY(tag_ids);\n INSERT INTO deleted_request_configs SELECT * FROM request_configs WHERE id = ANY(request_config_ids);\n INSERT INTO deleted_request_yaml_configs SELECT * FROM request_yaml_configs WHERE id = ANY(request_yaml_config_ids);\n INSERT INTO deleted_request_raw_configurations SELECT * FROM request_raw_configurations WHERE id = ANY(request_raw_configuration_ids);\n INSERT INTO deleted_request_raw_configs SELECT * FROM request_raw_configs WHERE id = ANY(request_raw_config_ids);\n\n DELETE FROM jobs WHERE id = ANY(job_ids);\n DELETE FROM stages WHERE id = ANY(stage_ids);\n DELETE FROM request_payloads WHERE id = ANY(request_payload_ids);\n DELETE FROM requests WHERE id = ANY(request_ids);\n DELETE FROM commits WHERE id = ANY(commit_ids);\n DELETE FROM pull_requests WHERE id = ANY(pull_request_ids);\n DELETE FROM builds WHERE id = ANY(build_ids);\n DELETE FROM job_configs WHERE id = ANY(job_config_ids);\n DELETE FROM build_configs WHERE id = ANY(build_config_ids);\n DELETE FROM ssl_keys WHERE id = ANY(ssl_key_ids);\n DELETE FROM tags WHERE id = ANY(tag_ids);\n DELETE FROM request_configs WHERE id = ANY(request_config_ids);\n DELETE FROM request_yaml_configs WHERE id = ANY(request_yaml_config_ids);\n DELETE FROM request_raw_configurations WHERE id = ANY(request_raw_configuration_ids);\n DELETE FROM request_raw_configs WHERE id = ANY(request_raw_config_ids);\nEND;\n$$ LANGUAGE plpgsql;\n")3067 -> 0.0019s3068== 20190725103113 UpdateSoftDelete: migrated (0.0043s) ========================3070== 20190725105934 AddOrgIdToConfigs: migrating ================================3071-- add_column(:job_configs, :org_id, :bigint)3072 -> 0.0008s3073-- add_column(:deleted_job_configs, :org_id, :bigint)3074 -> 0.0007s3075-- add_column(:build_configs, :org_id, :bigint)3076 -> 0.0009s3077-- add_column(:deleted_build_configs, :org_id, :bigint)3078 -> 0.0009s3079-- add_column(:request_configs, :org_id, :bigint)3080 -> 0.0015s3081-- add_column(:deleted_request_configs, :org_id, :bigint)3082 -> 0.0009s3083-- add_column(:request_yaml_configs, :org_id, :bigint)3084 -> 0.0008s3085-- add_column(:deleted_request_yaml_configs, :org_id, :bigint)3086 -> 0.0009s3087-- add_column(:request_payloads, :org_id, :bigint)3088 -> 0.0009s3089-- add_column(:deleted_request_payloads, :org_id, :bigint)3090 -> 0.0009s3091-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_job_configs_on_org_id ON job_configs (org_id)")3092 -> 0.0009s3093-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_build_configs_on_org_id ON build_configs (org_id)")3094 -> 0.0009s3095-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_request_configs_on_org_id ON request_configs (org_id)")3096 -> 0.0008s3097-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_request_yaml_configs_on_org_id ON request_yaml_configs (org_id)")3098 -> 0.0008s3099-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_request_payloads_on_org_id ON request_payloads (org_id)")3100 -> 0.0008s3101== 20190725105934 AddOrgIdToConfigs: migrated (0.0145s) =======================3103== 20190729105934 AddOrgAndComIdsToRawConfigs: migrating ======================3104-- add_column(:request_raw_configs, :org_id, :bigint)3105 -> 0.0009s3106-- add_column(:request_raw_configurations, :org_id, :bigint)3107 -> 0.0008s3108-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_request_raw_configs_on_org_id ON request_raw_configs (org_id)")3109 -> 0.0010s3110-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_request_raw_configurations_on_org_id ON request_raw_configurations (org_id)")3111 -> 0.0011s3112== 20190729105934 AddOrgAndComIdsToRawConfigs: migrated (0.0042s) =============3114== 20190801120510 AddMoreDeletedTables: migrating =============================3115-- execute("create table if not exists deleted_request_raw_configs (like request_raw_configs)")3116 -> 0.0020s3117-- execute("create table if not exists deleted_request_raw_configurations (like request_raw_configurations)")3118 -> 0.0013s3119-- execute("DROP FUNCTION IF EXISTS soft_delete_repo_data(bigint);\nCREATE FUNCTION soft_delete_repo_data(r_id bigint) RETURNS void AS $$\nDECLARE\n request_raw_config_ids bigint[];\n request_raw_configuration_ids bigint[];\n request_yaml_config_ids bigint[];\n request_config_ids bigint[];\n tag_ids bigint[];\n ssl_key_ids bigint[];\n build_config_ids bigint[];\n job_config_ids bigint[];\n build_ids bigint[];\n pull_request_ids bigint[];\n commit_ids bigint[];\n request_ids bigint[];\n request_payload_ids bigint[];\n stage_ids bigint[];\n job_ids bigint[];\nBEGIN\n SELECT INTO job_ids array_agg(id) FROM jobs WHERE repository_id = r_id;\n SELECT INTO stage_ids array_agg(id) FROM stages WHERE build_id IN (SELECT id FROM builds WHERE repository_id = r_id);\n SELECT INTO request_payload_ids array_agg(id) FROM request_payloads WHERE request_id IN (SELECT id FROM requests WHERE repository_id = r_id);\n SELECT INTO request_ids array_agg(id) FROM requests WHERE repository_id = r_id;\n SELECT INTO commit_ids array_agg(id) FROM commits WHERE repository_id = r_id;\n SELECT INTO pull_request_ids array_agg(id) FROM pull_requests WHERE repository_id = r_id;\n SELECT INTO build_ids array_agg(id) FROM builds WHERE repository_id = r_id;\n SELECT INTO job_config_ids array_agg(id) FROM job_configs WHERE repository_id = r_id;\n SELECT INTO build_config_ids array_agg(id) FROM build_configs WHERE repository_id = r_id;\n SELECT INTO ssl_key_ids array_agg(id) FROM ssl_keys WHERE repository_id = r_id;\n SELECT INTO tag_ids array_agg(id) FROM tags WHERE repository_id = r_id;\n SELECT INTO request_config_ids array_agg(id) FROM request_configs WHERE repository_id = r_id;\n SELECT INTO request_yaml_config_ids array_agg(id) FROM request_yaml_configs WHERE repository_id = r_id;\n SELECT INTO request_raw_configuration_ids array_agg(id) FROM request_raw_configurations WHERE request_id = ANY(request_ids);\n SELECT INTO request_raw_config_ids array_agg(id) FROM request_raw_configs WHERE id IN (SELECT request_raw_config_id FROM request_raw_configurations WHERE request_id = ANY(request_ids));\n\n INSERT INTO deleted_jobs SELECT * FROM jobs WHERE id = ANY(job_ids);\n INSERT INTO deleted_stages SELECT * FROM stages WHERE id = ANY(stage_ids);\n INSERT INTO deleted_request_payloads SELECT * FROM request_payloads WHERE id = ANY(request_payload_ids);\n INSERT INTO deleted_requests SELECT * FROM requests WHERE id = ANY(request_ids);\n INSERT INTO deleted_commits SELECT * FROM commits WHERE id = ANY(commit_ids);\n INSERT INTO deleted_pull_requests SELECT * FROM pull_requests WHERE id = ANY(pull_request_ids);\n INSERT INTO deleted_builds SELECT * FROM builds WHERE id = ANY(build_ids);\n INSERT INTO deleted_job_configs SELECT * FROM job_configs WHERE id = ANY(job_config_ids);\n INSERT INTO deleted_build_configs SELECT * FROM build_configs WHERE id = ANY(build_config_ids);\n INSERT INTO deleted_ssl_keys SELECT * FROM ssl_keys WHERE id = ANY(ssl_key_ids);\n INSERT INTO deleted_tags SELECT * FROM tags WHERE id = ANY(tag_ids);\n INSERT INTO deleted_request_configs SELECT * FROM request_configs WHERE id = ANY(request_config_ids);\n INSERT INTO deleted_request_yaml_configs SELECT * FROM request_yaml_configs WHERE id = ANY(request_yaml_config_ids);\n INSERT INTO deleted_request_raw_configurations SELECT * FROM request_raw_configurations WHERE id = ANY(request_raw_configuration_ids);\n INSERT INTO deleted_request_raw_configs SELECT * FROM request_raw_configs WHERE id = ANY(request_raw_config_ids);\n\n DELETE FROM jobs WHERE id = ANY(job_ids);\n DELETE FROM stages WHERE id = ANY(stage_ids);\n DELETE FROM request_payloads WHERE id = ANY(request_payload_ids);\n DELETE FROM requests WHERE id = ANY(request_ids);\n DELETE FROM commits WHERE id = ANY(commit_ids);\n DELETE FROM pull_requests WHERE id = ANY(pull_request_ids);\n DELETE FROM builds WHERE id = ANY(build_ids);\n DELETE FROM job_configs WHERE id = ANY(job_config_ids);\n DELETE FROM build_configs WHERE id = ANY(build_config_ids);\n DELETE FROM ssl_keys WHERE id = ANY(ssl_key_ids);\n DELETE FROM tags WHERE id = ANY(tag_ids);\n DELETE FROM request_configs WHERE id = ANY(request_config_ids);\n DELETE FROM request_yaml_configs WHERE id = ANY(request_yaml_config_ids);\n DELETE FROM request_raw_configurations WHERE id = ANY(request_raw_configuration_ids);\n DELETE FROM request_raw_configs WHERE id = ANY(request_raw_config_ids);\nEND;\n$$ LANGUAGE plpgsql;\n")3120 -> 0.0025s3121== 20190801120510 AddMoreDeletedTables: migrated (0.0563s) ====================3123== 20190815152336 AddComIdToMoreTables: migrating =============================3124-- add_column(:request_configs, :com_id, :bigint)3125 -> 0.0009s3126-- add_column(:request_yaml_configs, :com_id, :bigint)3127 -> 0.0007s3128-- add_column(:deleted_request_configs, :com_id, :bigint)3129 -> 0.0006s3130-- add_column(:deleted_request_yaml_configs, :com_id, :bigint)3131 -> 0.0005s3132-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_request_configs_on_com_id ON request_configs (com_id)")3133 -> 0.0009s3134-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_request_yaml_configs_on_com_id ON request_yaml_configs (com_id)")3135 -> 0.0008s3136== 20190815152336 AddComIdToMoreTables: migrated (0.0049s) ====================3138== 20190815164320 AddComIdToBuildConfigs: migrating ===========================3139-- add_column(:build_configs, :com_id, :bigint)3140 -> 0.0006s3141-- add_column(:deleted_build_configs, :com_id, :bigint)3142 -> 0.0009s3143-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_build_configs_on_com_id ON build_configs (com_id)")3144 -> 0.0015s3145== 20190815164320 AddComIdToBuildConfigs: migrated (0.0036s) ==================3147== 20190815172205 AddComIdToJobConfigs: migrating =============================3148-- add_column(:job_configs, :com_id, :bigint)3149 -> 0.0020s3150-- add_column(:deleted_job_configs, :com_id, :bigint)3151 -> 0.0018s3152-- execute("CREATE UNIQUE INDEX CONCURRENTLY index_job_configs_on_com_id ON job_configs (com_id)")3153 -> 0.0017s3154== 20190815172205 AddComIdToJobConfigs: migrated (0.0062s) ====================3156== 20190819082558 AddVcsIdToUser: migrating ===================================3157-- add_column(:users, :vcs_id, :string, {:default=>nil})3158 -> 0.0026s3159-- execute("CREATE INDEX CONCURRENTLY index_users_on_vcs_id_and_vcs_type ON users (vcs_id, vcs_type);")3160 -> 0.0013s3161== 20190819082558 AddVcsIdToUser: migrated (0.0043s) ==========================3163== 20190819082559 AddVcsIdToRepository: migrating =============================3164-- add_column(:repositories, :vcs_id, :string, {:default=>nil})3165 -> 0.0014s3166-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_vcs_id_and_vcs_type ON repositories (vcs_id, vcs_type);")3167 -> 0.0011s3168== 20190819082559 AddVcsIdToRepository: migrated (0.0026s) ====================3170== 20190820082431 AddVcsIdToOrganization: migrating ===========================3171-- add_column(:organizations, :vcs_id, :string, {:default=>nil})3172 -> 0.0013s3173-- execute("CREATE INDEX CONCURRENTLY index_organizations_on_vcs_id_and_vcs_type ON organizations (vcs_id, vcs_type);")3174 -> 0.0010s3175== 20190820082431 AddVcsIdToOrganization: migrated (0.0024s) ==================3177== 20190913092543 CopyVcsIdForRepository: migrating ===========================3178-- select_value("SELECT id FROM repositories ORDER BY id DESC LIMIT 1")3179 -> 0.0011s3180-- execute("UPDATE \"repositories\" SET vcs_id = github_id WHERE id BETWEEN 0 AND 5000")3181 -> 0.0013s3182== 20190913092543 CopyVcsIdForRepository: migrated (0.0030s) ==================3184== 20190913092554 CopyVcsIdForUser: migrating =================================3185-- select_value("SELECT id FROM users ORDER BY id DESC LIMIT 1")3186 -> 0.0010s3187-- execute("UPDATE \"users\" SET vcs_id = github_id WHERE id BETWEEN 0 AND 5000")3188 -> 0.0009s3189== 20190913092554 CopyVcsIdForUser: migrated (0.0024s) ========================3191== 20190913092565 CopyVcsIdForOrganization: migrating =========================3192-- select_value("SELECT id FROM organizations ORDER BY id DESC LIMIT 1")3193 -> 0.0010s3194-- execute("UPDATE \"organizations\" SET vcs_id = github_id WHERE id BETWEEN 0 AND 5000")3195 -> 0.0008s3196== 20190913092565 CopyVcsIdForOrganization: migrated (0.0022s) ================3198== 20190920160300 MessagesAddTypeSourceLine: migrating ========================3199-- add_column(:messages, :type, :string, {:default=>nil})3200 -> 0.0013s3201-- add_column(:messages, :src, :string, {:default=>nil})3202 -> 0.0010s3203-- add_column(:messages, :line, :integer, {:default=>nil})3204 -> 0.0011s3205== 20190920160300 MessagesAddTypeSourceLine: migrated (0.0035s) ===============3207== 20191112000000 ReposAddFork: migrating =====================================3208-- add_column(:repositories, :fork, :boolean, {:default=>nil})3209 -> 0.0013s3210== 20191112000000 ReposAddFork: migrated (0.0014s) ============================3212== 20191112172015 AddVcsIndexToRepositories: migrating ========================3213-- add_index(:repositories, [:vcs_type, :vcs_id], {:algorithm=>:concurrently})3214 -> 0.0015s3215== 20191112172015 AddVcsIndexToRepositories: migrated (0.0016s) ===============3217== 20191112172332 AddVcsIndexToUsers: migrating ===============================3218-- add_index(:users, [:vcs_type, :vcs_id], {:algorithm=>:concurrently})3219 -> 0.0009s3220== 20191112172332 AddVcsIndexToUsers: migrated (0.0009s) ======================3222== 20191219091445 AddHeadRepoVcsIdToPullRequest: migrating ====================3223-- add_column(:pull_requests, :head_repo_vcs_id, :string, {:default=>nil})3224 -> 0.0009s3225-- execute("CREATE INDEX CONCURRENTLY index_pull_requests_on_head_repo_vcs_id ON pull_requests (head_repo_vcs_id);")3226 -> 0.0007s3227== 20191219091445 AddHeadRepoVcsIdToPullRequest: migrated (0.0017s) ===========3229== 20191219091446 AddHeadRepoVcsIdToDeletedPullRequest: migrating =============3230-- add_column(:deleted_pull_requests, :head_repo_vcs_id, :string, {:default=>nil})3231 -> 0.0008s3232-- execute("CREATE INDEX CONCURRENTLY index_deleted_pull_requests_on_head_repo_vcs_id ON deleted_pull_requests (head_repo_vcs_id);")3233 -> 0.0006s3234== 20191219091446 AddHeadRepoVcsIdToDeletedPullRequest: migrated (0.0015s) ====3236== 20200122000000 AddConfigsJson: migrating ===================================3237-- add_column(:request_configs, :config_json, :json)3238 -> 0.0007s3239-- add_column(:build_configs, :config_json, :json)3240 -> 0.0005s3241-- add_column(:job_configs, :config_json, :json)3242 -> 0.0004s3243-- add_column(:deleted_request_configs, :config_json, :json)3244 -> 0.0005s3245-- add_column(:deleted_build_configs, :config_json, :json)3246 -> 0.0005s3247-- add_column(:deleted_job_configs, :config_json, :json)3248 -> 0.0005s3249== 20200122000000 AddConfigsJson: migrated (0.0034s) ==========================3251== 20200127000000 DropJobConfigsGpu: migrating ================================3252-- execute("DROP MATERIALIZED VIEW job_configs_gpu\n")3253 -> 0.0008s3254== 20200127000000 DropJobConfigsGpu: migrated (0.0008s) =======================3256== 20200127000001 RenameConfigsJson: migrating ================================3257-- remove_column(:request_configs, :config)3258 -> 0.0011s3259-- rename_column(:request_configs, :config_json, :config)3260 -> 0.0031s3261-- remove_column(:build_configs, :config)3262 -> 0.0005s3263-- rename_column(:build_configs, :config_json, :config)3264 -> 0.0035s3265-- remove_column(:job_configs, :config)3266 -> 0.0007s3267-- rename_column(:job_configs, :config_json, :config)3268 -> 0.0034s3269-- remove_column(:deleted_request_configs, :config)3270 -> 0.0004s3271-- rename_column(:deleted_request_configs, :config_json, :config)3272 -> 0.0013s3273-- remove_column(:deleted_build_configs, :config)3274 -> 0.0005s3275-- rename_column(:deleted_build_configs, :config_json, :config)3276 -> 0.0012s3277-- remove_column(:deleted_job_configs, :config)3278 -> 0.0005s3279-- rename_column(:deleted_job_configs, :config_json, :config)3280 -> 0.0012s3281== 20200127000001 RenameConfigsJson: migrated (0.0181s) =======================3283== 20200214144655 AddIndexToJobVersionsOnJobId: migrating =====================3284-- add_index(:job_versions, :job_id, {:algorithm=>:concurrently})3285 -> 0.0010s3286== 20200214144655 AddIndexToJobVersionsOnJobId: migrated (0.0011s) ============3288== 20200225085734 AddVcsSlugToRepository: migrating ===========================3289-- add_column(:repositories, :vcs_slug, :string, {:default=>nil})3290 -> 0.0010s3291== 20200225085734 AddVcsSlugToRepository: migrated (0.0011s) ==================3293== 20200227085734 AddVcsSourceHostToRepository: migrating =====================3294-- add_column(:repositories, :vcs_source_host, :string, {:default=>nil})3295 -> 0.0010s3296== 20200227085734 AddVcsSourceHostToRepository: migrated (0.0010s) ============3298== 20200227085736 AddVcsIndexes: migrating ====================================3299-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_lower_slug_or_on_lower_owner_name ON repositories (LOWER(vcs_slug), LOWER(owner_name), LOWER(name), LOWER(vcs_type)) WHERE invalidated_at IS NULL")3300 -> 0.0014s3301== 20200227085736 AddVcsIndexes: migrated (0.0014s) ===========================3303== 20200227085737 AddRepositoryNameAndSlugIndex: migrating ====================3304-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_slug_or_names ON repositories (vcs_slug, owner_name, name) WHERE invalidated_at IS NULL")3305 -> 0.0012s3306== 20200227085737 AddRepositoryNameAndSlugIndex: migrated (0.0012s) ===========3308== 20200227085742 AddPullRequestSourceData: migrating =========================3309-- add_column(:pull_requests, :base_repo_slug, :string, {:default=>nil})3310 -> 0.0010s3311-- add_column(:pull_requests, :base_repo_vcs_id, :string, {:default=>nil})3312 -> 0.0009s3313-- add_column(:pull_requests, :base_ref, :string, {:default=>nil})3314 -> 0.0010s3315-- add_column(:deleted_pull_requests, :base_repo_slug, :string, {:default=>nil})3316 -> 0.0009s3317-- add_column(:deleted_pull_requests, :base_repo_vcs_id, :string, {:default=>nil})3318 -> 0.0008s3319-- add_column(:deleted_pull_requests, :base_ref, :string, {:default=>nil})3320 -> 0.0009s3321== 20200227085742 AddPullRequestSourceData: migrated (0.0059s) ================3323== 20200312184018 AddUserUtmParamsTable: migrating ============================3324-- create_table(:user_utm_params)3325 -> 0.0036s3326== 20200312184018 AddUserUtmParamsTable: migrated (0.0037s) ===================3328== 20200316085738 AddRepositoryVcsSlugIndex: migrating ========================3329-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_lower_vcs_slug ON repositories (LOWER(vcs_slug))")3330 -> 0.0011s3331-- execute("CREATE INDEX CONCURRENTLY index_repositories_on_lower_vcs_slug_valid ON repositories (LOWER(vcs_slug)) WHERE invalidated_at IS NULL")3332 -> 0.0010s3333== 20200316085738 AddRepositoryVcsSlugIndex: migrated (0.0022s) ===============3335== 20200325115329 AddMultipleJobStateIndexesOrderByNewest: migrating ==========3336-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_booting_jobs_on_repository_id_order_by_newest on jobs (repository_id, id desc) where state = 'booting'")3337 -> 0.0011s3338-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_canceled_jobs_on_repository_id_order_by_newest on jobs (repository_id, id desc) where state = 'canceled'")3339 -> 0.0014s3340-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_created_jobs_on_repository_id_order_by_newest on jobs (repository_id, id desc) where state = 'created'")3341 -> 0.0011s3342-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_errored_jobs_on_repository_id_order_by_newest on jobs (repository_id, id desc) where state = 'errored'")3343 -> 0.0010s3344-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_failed_jobs_on_repository_id_order_by_newest on jobs (repository_id, id desc) where state = 'failed'")3345 -> 0.0011s3346-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_passed_jobs_on_repository_id_order_by_newest on jobs (repository_id, id desc) where state = 'passed'")3347 -> 0.0013s3348-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_queued_jobs_on_repository_id_order_by_newest on jobs (repository_id, id desc) where state = 'queued'")3349 -> 0.0013s3350-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_received_jobs_on_repository_id_order_by_newest on jobs (repository_id, id desc) where state = 'received'")3351 -> 0.0013s3352-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_started_jobs_on_repository_id_order_by_newest on jobs (repository_id, id desc) where state = 'started'")3353 -> 0.0013s3354== 20200325115329 AddMultipleJobStateIndexesOrderByNewest: migrated (0.0113s) =3356== 20200325130013 AddFunctionMostRecentJobIdsForUserRepositoriesByStates: migrating3357-- execute("\n CREATE OR REPLACE FUNCTION\n most_recent_job_ids_for_user_repositories_by_states(uid int, states varchar default '') RETURNS table (id bigint) AS\n $BODY$\n DECLARE\n rid int;\n BEGIN\n SET LOCAL work_mem = '16MB';\n IF states <> '' THEN\n RETURN QUERY WITH matrix AS (\n SELECT repository_id, replace(replace(job_state::varchar, '(', ''), ')', '') as job_state\n FROM permissions p\n CROSS JOIN (\n SELECT unnest(regexp_split_to_array(states, ','))\n ) AS job_state\n WHERE p.user_id = uid\n )\n SELECT recent.id\n FROM matrix m\n CROSS JOIN LATERAL (\n SELECT job_id AS id, repository_id\n FROM most_recent_job_ids_for_repository_by_state(m.repository_id, m.job_state::varchar)\n ) AS recent\n ORDER BY id desc;\n ELSE\n for rid in\n SELECT repository_id\n FROM permissions\n WHERE user_id = uid\n LOOP\n RETURN QUERY select j.id from jobs j where repository_id = rid order by j.id desc limit 100;\n END LOOP;\n END IF;\n END\n $BODY$\n LANGUAGE plpgsql;\n ")3358 -> 0.0011s3359== 20200325130013 AddFunctionMostRecentJobIdsForUserRepositoriesByStates: migrated (0.0012s)3361== 20200330110527 AddFunctionMostRecentJobIdsForRepositoryByState: migrating ==3362-- execute("\n CREATE OR REPLACE FUNCTION\n most_recent_job_ids_for_repository_by_state(rid int, st varchar) RETURNS table (job_id bigint, repository_id int) AS\n $BODY$\n DECLARE\n BEGIN\n RETURN QUERY select j.id, j.repository_id from jobs j where j.repository_id = rid and j.state = st order by j.id desc limit 100;\n END\n $BODY$\n LANGUAGE plpgsql;\n ")3363 -> 0.0008s3364== 20200330110527 AddFunctionMostRecentJobIdsForRepositoryByState: migrated (0.0009s)3366== 20200406121218 AddIndexJobsOnRepositoryIdOrderByNewest: migrating ==========3367-- execute("CREATE INDEX CONCURRENTLY IF NOT EXISTS index_jobs_on_repository_id_order_by_newest on jobs (repository_id, id desc)")3368 -> 0.0010s3369== 20200406121218 AddIndexJobsOnRepositoryIdOrderByNewest: migrated (0.0011s) =3371== 20200424000000 RequestRawConfigurationsAddMergeMode: migrating =============3372-- add_column(:request_raw_configurations, :merge_mode, :string, {:default=>nil})3373 -> 0.0010s3374-- add_column(:deleted_request_raw_configurations, :merge_mode, :string, {:default=>nil})3375 -> 0.0010s3376== 20200424000000 RequestRawConfigurationsAddMergeMode: migrated (0.0021s) ====3378== 20200527123653 AddColumnPriorityToTableJobsAndDeletedJobs: migrating =======3379-- add_column(:jobs, :priority, :integer, {:default=>nil})3380 -> 0.0011s3381-- add_column(:deleted_jobs, :priority, :integer, {:default=>nil})3382 -> 0.0010s3383== 20200527123653 AddColumnPriorityToTableJobsAndDeletedJobs: migrated (0.0022s)3385== 20200928143126 AddBuildTriggerPermissions: migrating =======================3386-- add_column(:memberships, :build_permission, :boolean, {:default=>nil})3387 -> 0.0012s3388-- add_column(:permissions, :build, :boolean, {:default=>nil})3389 -> 0.0009s3390== 20200928143126 AddBuildTriggerPermissions: migrated (0.0022s) ==============3392== 20202427123653 AddColumnHasLocalRegistrationToTableSubscriptions: migrating3393-- add_column(:subscriptions, :has_local_registration, :boolean, {:default=>nil})3394 -> 0.0009s3395== 20202427123653 AddColumnHasLocalRegistrationToTableSubscriptions: migrated (0.0011s)3397== 20210203130200 CreateBuildBackupsTable: migrating ==========================3398-- create_table(:build_backups, {:id=>:integer})3399 -> 0.0033s3400== 20210203130200 CreateBuildBackupsTable: migrated (0.0034s) =================3402== 20210203143155 AddConfirmationFieldsToUser: migrating ======================3403-- add_column(:users, :confirmed_at, :timestamp, {:precision=>nil})3404 -> 0.0006s3405-- add_column(:users, :token_expires_at, :timestamp, {:precision=>nil})3406 -> 0.0006s3407-- add_column(:users, :confirmation_token, :string)3408 -> 0.0007s3409-- add_index(:users, :confirmation_token)3410 -> 0.0009s3411== 20210203143155 AddConfirmationFieldsToUser: migrated (0.0029s) =============3413== 20210203143406 ConfirmCurrentUsers: migrating ==============================3414== 20210203143406 ConfirmCurrentUsers: migrated (0.0000s) =====================3416== 20210614140633 AddServerTypeToRepositories: migrating ======================3417-- add_column(:repositories, :server_type, :string, {:limit=>20})3418 -> 0.0014s3419== 20210614140633 AddServerTypeToRepositories: migrated (0.0016s) =============3421== 20220621151453 AddColumnRestartedByToTableJobs: migrating ==================3422-- add_column(:jobs, :restarted_by, :integer, {:default=>nil})3423 -> 0.0016s3424-- add_column(:deleted_jobs, :restarted_by, :integer, {:default=>nil})3425 -> 0.0009s3426== 20220621151453 AddColumnRestartedByToTableJobs: migrated (0.0027s) =========3428== 20220722162400 CreateAuditsTable: migrating ================================3429-- create_table(:audits)3430 -> 0.0033s3431== 20220722162400 CreateAuditsTable: migrated (0.0034s) =======================3433== 20220825140522 CreateCustomKeysTable: migrating ============================3434-- create_table(:custom_keys)3435 -> 0.0086s3436== 20220825140522 CreateCustomKeysTable: migrated (0.0090s) ===================3438== 20220905144600 AddScanFailedAtToRepositories: migrating ====================3439-- add_column(:repositories, :scan_failed_at, :timestamp)3440 -> 0.0034s3441== 20220905144600 AddScanFailedAtToRepositories: migrated (0.0037s) ===========3443== 20221214171030 AddPurposeColumnToTokens: migrating =========================3444-- add_column(:tokens, :purpose, :integer, {:limit=>4, :default=>0})3445 -> 0.0069s3446== 20221214171030 AddPurposeColumnToTokens: migrated (0.0073s) ================3448== 20230208161446 AddCloneUrlToRepositories: migrating ========================3449-- add_column(:repositories, :clone_url, :string)3450 -> 0.0012s3451== 20230208161446 AddCloneUrlToRepositories: migrated (0.0013s) ===============3453== 20230505055250 RolifyCreateRoles: migrating ================================3454-- create_table(:roles)3455 -> 0.0045s3456-- create_table(:role_names)3457 -> 0.0034s3458-- create_table(:users_roles, {:id=>false})3459 -> 0.0036s3460-- add_index(:roles, :name)3461 -> 0.0011s3462-- add_index(:role_names, :name)3463 -> 0.0010s3464-- add_index(:roles, [:name, :resource_type, :resource_id])3465 -> 0.0011s3466-- add_index(:users_roles, [:user_id, :role_id])3467 -> 0.0010s3468== 20230505055250 RolifyCreateRoles: migrated (0.0164s) =======================3470== 20230505060110 CreatePolicies: migrating ===================================3471-- create_table(:policy_permissions)3472 -> 0.0039s3473-- create_table(:role_permissions, {:id=>false})3474 -> 0.0033s3475-- add_index(:policy_permissions, :name)3476 -> 0.0015s3477-- add_index(:role_permissions, [:role_name_id, :policy_permission_id])3478 -> 0.0010s3479== 20230505060110 CreatePolicies: migrated (0.0102s) ==========================3481== 20230713115855 CreatePermissionsSync: migrating ============================3482-- create_table(:permissions_syncs)3483 -> 0.0060s3484== 20230713115855 CreatePermissionsSync: migrated (0.0061s) ===================3486== 20231005111642 CreatePermissionsIndex: migrating ===========================3487-- add_index(:permissions_syncs, [:user_id, :resource_type, :resource_id], {:name=>"index_permissions_syncs_on_user_and_resource"})3488 -> 0.0017s3489-- add_index(:role_names, :role_type)3490 -> 0.0010s3491== 20231005111642 CreatePermissionsIndex: migrated (0.0030s) ==================3493 sets unique_number on INSERT3494 does not set unique_number on INSERT if 0 is given as a value3495 sets unique_number on UPDATE3496 does not set unique_number on UPDATE if unique_number is 03498set_updated_at trigger3499 jobs3500 sets updated_at on INSERT3501 sets updated_at on UPDATE3502 works also for new columns3503 builds3504 sets updated_at on INSERT3505 sets updated_at on UPDATE3506 works also for new columns3508soft delete repo3509 ensure that soft delete tables have the same fields that the originals3510 soft deleting a repo moves all of the related data to deleted_* tables3512Rake tasks3513 rake db:create3514 migrates the main db3515 rake db:schema:load3516 loads the main schema3518Deprecation Warnings:3520Using `should` from rspec-expectations' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` with `config.expect_with(:rspec) { |c| c.syntax = :should }` instead. Called from /home/travis/build/travis-ci/travis-migrations/spec/soft_delete_repo_spec.rb:118:in `block (2 levels) in <top (required)>'.3523If you need more of the backtrace for any of these deprecations to3524identify where to make the necessary changes, you can configure3525`config.raise_errors_for_deprecations!`, and it will turn the3526deprecation warnings into errors, giving you the full backtrace.35281 deprecation warning total3530Finished in 21.56 seconds (files took 0.35202 seconds to load)353119 examples, 0 failures3533The command "bundle exec rspec spec" exited with 0.after_success3538<internal:/home/travis/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- s3 (LoadError)3539 from <internal:/home/travis/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'3540 from script/upload_structure.rb:5:in `<main>'3542Done. Your build exited with 0.