Ошибка тип serial не существует

I have run into a strange problem with Postgres 9 on Mac OS X, I have the following statement which works on Windows Postgres but on on Mac OS postgres

CREATE DOMAIN pkey_domain AS SERIAL PRIMARY KEY;

returns

ERROR: type «serial» does not exist

*** Error ***

ERROR: type «serial» does not exist
SQL state: 42704

SERIAL is a data type that is supported by postgres why am I not able to create a Domain with it? Does the deafult installer on the Mac not create the type?

asked Jul 5, 2011 at 9:40

ams's user avatar

1

Serial isn’t really a type, it is a kind of macro that creates the sequence for you, sets the default value of the column, etc. It is not referenced in pg_type. So you can’t use it like this.

answered Jul 5, 2011 at 11:00

bobflux's user avatar

bobfluxbobflux

11.1k3 gold badges26 silver badges27 bronze badges

4

Перейти к контенту

I have run into a strange problem with Postgres 9 on Mac OS X, I have the following statement which works on Windows Postgres but on on Mac OS postgres

CREATE DOMAIN pkey_domain AS SERIAL PRIMARY KEY;

returns

ERROR: type «serial» does not exist

*** Error ***

ERROR: type «serial» does not exist
SQL state: 42704

SERIAL is a data type that is supported by postgres why am I not able to create a Domain with it? Does the deafult installer on the Mac not create the type?

asked Jul 5, 2011 at 9:40

ams's user avatar

1

Serial isn’t really a type, it is a kind of macro that creates the sequence for you, sets the default value of the column, etc. It is not referenced in pg_type. So you can’t use it like this.

answered Jul 5, 2011 at 11:00

bobflux's user avatar

bobfluxbobflux

10.9k3 gold badges26 silver badges26 bronze badges

4

Issue Description

I getting error type "serial" does not exist

What are you doing?

// postgres.js
const sql = new Sequelize(db, username, password, {
  host,
  port,
  dialect: 'postgres',
  dialectOptions: {
    ssl: false
  },
  logging: false,

  define: {
    timestamps: false,
    charset: 'utf8'
  }
});

sql
  .sync({ alter: true })
  .catch((err) =>
    logger.error(
      `[PostgreSQL]: Unable to the sync tables from server;
      ${err.message}
      ${err.parent && err.parent.sql ? '; with these SQL Query' : ''}
      ${err.parent && err.parent.sql ? 'n' : ''}
      ${(err.parent && err.parent.sql) || ''}`
    )
  )
  .then(() => sql.authenticate())
  .then(() =>
    logger.info('[PostgreSQL]: Connection has been established successfully.')
  )
  .catch((err) =>
    logger.error(
      `[PostgreSQL]: Unable to connect to the database
      ${err.message}`
    )
  );

export default sql;

// the file error happening
import DataTypes from 'sequelize';
import { v4 as uuidv4 } from 'uuid';
import sequelize from '../connections/postgres.js';

export default sequelize.define(
  'Order',
  {
    id: {
      type: DataTypes.UUID,
      defaultValue() {
        return uuidv4();
      },
      primaryKey: true
    },
    seqNo: {
      type: DataTypes.INTEGER,
      autoIncrement: true
    },
    description: {
      type: DataTypes.STRING,
      allowNull: false
    }
  },
  {
    freezeTableName: true,
    // define the table's name
    tableName: 'orders'
  }
);

What do you expect to happen?

Successfully sync, altering table

What is actually happening?

[PostgreSQL]: Unable to the sync tables from server;
      type "serial" does not exist
      ; with these SQL Query
      

      ALTER TABLE "orders" ALTER COLUMN "seqNo" DROP NOT NULL;ALTER TABLE "orders" ALTER COLUMN "seqNo" DROP DEFAULT;ALTER TABLE "orders" ALTER COLUMN "seqNo" TYPE  SERIAL;
[PostgreSQL]: Connection has been established successfully.

Additional context

Add any other context or screenshots about the feature request here.

Environment

  • Sequelize version: v6.5.0
  • Node.js version: v15.13.0
  • Operating System: macOS Catalina 10.15.7
  • If TypeScript related: TypeScript version: XXX

Issue Template Checklist

How does this problem relate to dialects?

  • I think this problem happens regardless of the dialect.
  • I think this problem happens only for the following dialect(s):
  • I don’t know, I was using Postgres, with pg@8.5.1 and pg-hstore@2.x versions and database version postgres@12

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don’t know how to start, I would need guidance.
  • No, I don’t have the time, although I believe I could do it if I had the time…
  • No, I don’t have the time and I wouldn’t even know how to start.

jambas92

59 / 58 / 16

Регистрация: 18.11.2010

Сообщений: 315

1

10.03.2013, 19:31. Показов 4407. Ответов 3

Метки нет (Все метки)


Здравствуйте! Хочу создать id как primary key и чтобы был auto increment, в доке пишется что стоит просто написать SERIAL и все заработает, но написав выходит такая ошибка:
Код ошибки -1, положение SQL 42X94: TYPE ‘SERIAL’ не существует.

ОК, расписал я этот SERIAL как:

Oracle 11 SQL
1
2
3
4
5
6
CREATE SEQUENCE book_id_seq START WITH 1 INCREMENT BY 1;
CREATE TABLE Book
(
BookID INTEGER NOT NULL DEFAULT NEXTVAL('book_id_seq'),
...
CONSTRAINT BookID PRIMARY KEY (BookID),

выходит такая ошибка:
Код ошибки -1, положение SQL 42894: Значение DEFAULT или значение атрибута IDENTITY является недопустимым для столбца ‘BOOKID’.

использую Netbeans 7.2. Не знаю как решить эту проблему.

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

0

Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

10.03.2013, 19:31

Ответы с готовыми решениями:

Serial не работает
Таблица была создана следующим образом

create table schedule (
id SERIAL NOT NULL PRIMARY…

serial profile (bluetooth gps) — как работает?
уже час пытаюсь получить в терминале на компьютере вывод nmea сообщений с Digma BM100
делают…

Serial to Wi-Fi
Требуется реализовать передачу данных с компа на МК по wifi, для этого был вабран модуль MT800SWM….

Serial key
Всем привет! Меня интересует вот что… Я создаю программу и нуждаюсь в том что необходимо создать…

3

grgdvo

1184 / 914 / 367

Регистрация: 02.09.2012

Сообщений: 2,785

11.03.2013, 15:22

2

Может проблема в NetBeans?
Честно говоря никогда так не работал. Либо через терминал в psql, либо в pgadmin.
Например, вот так работает без проблем (PostgreSQL 9.2.1)

SQL
1
2
3
4
5
6
CREATE TABLE test
(
  id serial NOT NULL,
  testname CHARACTER VARYING(64)[],
  CONSTRAINT test_pkey PRIMARY KEY (id )
);

1

59 / 58 / 16

Регистрация: 18.11.2010

Сообщений: 315

11.03.2013, 18:27

 [ТС]

3

grgdvo, в pgadmine все работает грамотно. просто хотелось не отходя от кассы все в одном месте делать.

0

1184 / 914 / 367

Регистрация: 02.09.2012

Сообщений: 2,785

12.03.2013, 14:57

4

Я вот еще раз пересмотрел первый пост, почитал про NetBeans.
В официальной документации не написано про поддержку PostgreSQL базы.
Здесь, конечно, сказано, что поддерживает, но прямой ссылки нет на настройки как для Oracle, MySQL и JavaDB.
Однако, есть поддержка Postgresql через JDBC. Я вот подумал, может вам JDBC драйвер обновить для постгреса.

1

IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

12.03.2013, 14:57

Помогаю со студенческими работами здесь

Proteus serial
День добрый.

Можно ли в протее подключить эмулятор терминала (внешний или встроенный) в…

Qt и serial порт
Добрый день!
Я использую Qmake 5.5.1.
Установила qtserialport
1. git clone…

Эхо на Serial
Изучаю Arduino.
Не могу понять почему не выводится число, которое ввожу.
Объясните, пожалуйста.

QT serial port
Здравствуйте!

пытаюсь заставить работать ком порт в QT

для начала решил попробовать простой…

Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:

4

Ответ на:

комментарий
от pi11 01.11.17 00:13:34 MSK

Я к тому, что — создаешь секвинс, потом alter column set default nexval(‘твой_секвинс’);

вот тебе и поле сериал стало.

pi11 ★★★★★

(01.11.17 00:20:04 MSK)

  • Показать ответы
  • Ссылка

Ответ на:

комментарий
от pi11 01.11.17 00:20:04 MSK

спасибо, понятно.

cetjs2 ★★★★★

(01.11.17 00:23:27 MSK)

  • Ссылка

Ответ на:

комментарий
от pi11 01.11.17 00:20:04 MSK

Ещё не забыть сделать столбец таблицы владельцем последовательности.

  • Ссылка

В postgresql 10 уже стоит использовать тип identity/bigidentity — это улучшенный serial/bigserial.

dmitry_vk ★★★

(01.11.17 12:26:45 MSK)

  • Показать ответ
  • Ссылка

Ответ на:

комментарий
от dmitry_vk 01.11.17 12:26:45 MSK

Ответ на:

комментарий
от cetjs2 01.11.17 15:19:04 MSK

Ответ на:

комментарий
от anonymous 01.11.17 15:56:39 MSK

Ответ на:

комментарий
от anonymous 01.11.17 15:56:39 MSK

Ответ на:

комментарий
от cetjs2 01.11.17 15:19:04 MSK

Ответ на:

комментарий
от slovazap 01.11.17 17:00:23 MSK

Ответ на:

комментарий
от anonymous 02.11.17 00:01:30 MSK

Ответ на:

комментарий
от slovazap 02.11.17 12:53:42 MSK

Ну пруфани проблемы с пакетами из репозитория разрабов профпригодник ты наш, говорить все горазды.

anonymous

(02.11.17 16:21:28 MSK)

  • Ссылка

Ответ на:

комментарий
от slovazap 02.11.17 12:53:42 MSK

это отличный совет.
если чета начнет глючить,
в рассылке первым делом посоветуют поставить вместо левых пакетов из дистра, официальные, потом уже дальше будут разбираться.

этоже касается nginx и node.

drsm ★★

(02.11.17 19:47:02 MSK)

  • Показать ответ
  • Ссылка

Ответ на:

комментарий
от drsm 02.11.17 19:47:02 MSK

Поставить пакеты от авторов могут советовать только абсолютно безграмотные люди, это совет уровня «выключить и снова включить». Такие же безграмотные люди пишут эти пакеты, поскольку мантейнерами дистрибутива они не являются и от пакетирования очень далеки, пакет не проходит никакого review и QA, и также разрабатывается отдельно от основного репозитория, поэтому обновление основного репозитория может его в любой момент сломать. Я наступал в проблемы с «официальными» пакетами от авторов много раз, и держаться от них подальше — единственный действительно хороший совет.

slovazap ★★★★★

(02.11.17 21:21:07 MSK)

  • Ссылка

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.

Я столкнулся со странной проблемой с Postgres 9 в Mac OS X. У меня есть следующее утверждение, которое работает в Windows Postgres, но в Mac OS postgres.

СОЗДАТЬ ДОМЕН pkey_domain КАК ПОСЛЕДОВАТЕЛЬНЫЙ ПЕРВИЧНЫЙ КЛЮЧ;

Возвращает

ОШИБКА: тип «серийный» не существует

Ошибка ***

ОШИБКА: тип «серийный» не существует Состояние SQL: 42704

SERIAL — это тип данных, поддерживаемый postgres, почему я не могу создать с ним домен? Установщик по умолчанию на Mac не создает тип?

1 ответы

Serial на самом деле не является типом, это своего рода макрос, который создает для вас последовательность, устанавливает значение столбца по умолчанию и т. д. Он не упоминается в pg_type. Таким образом, вы не можете использовать его так.

Создан 05 июля ’11, 12:07

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

postgresql

or задайте свой вопрос.

I am having some issues with serial type lately. Problem reflects in some changes in the schema file that cannot be loaded later on, failing wiht exception:

PG::UndefinedObject: ERROR: type "serial" does not exist LINE 1: SELECT 'serial'::regtype::oid ^ /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:61:in `async_exec' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:61:in `block (2 levels) in query' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies/interlock.rb:46:in `block in permit_concurrent_loads' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/concurrency/share_lock.rb:185:in `yield_shares' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies/interlock.rb:45:in `permit_concurrent_loads' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:60:in `block in query' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:612:in `block (2 levels) in log' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:611:in `block in log' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/notifications/instrumenter.rb:21:in `instrument' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:603:in `log' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:59:in `query' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:70:in `query_value' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/quoting.rb:81:in `lookup_cast_type' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/quoting.rb:114:in `quote_default_expression' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/quoting.rb:71:in `quote_default_expression' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:17:in `quote_default_expression' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:103:in `add_column_options!' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:42:in `block in add_column_options!' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:41:in `add_column_options!' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/schema_creation.rb:10:in `add_column_options!' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:34:in `visit_ColumnDefinition' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:14:in `accept' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:45:in `block in visit_TableDefinition' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:45:in `map' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:45:in `visit_TableDefinition' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:48:in `block in visit_TableDefinition' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:47:in `visit_TableDefinition' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:14:in `accept' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:288:in `create_table' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:28:in `block in create_table' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:27:in `create_table' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:849:in `block in method_missing' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:818:in `block in say_with_time' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:818:in `say_with_time' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:838:in `method_missing' /home/broisatse/work/Hubbado/hubbadoproto/db/schema.rb:20:in `block in <main>' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/schema.rb:48:in `instance_eval' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/schema.rb:48:in `define' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/schema.rb:44:in `define' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/schema.rb:7:in `block in define' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/schema.rb:6:in `define' /home/broisatse/work/Hubbado/hubbadoproto/db/schema.rb:13:in `<main>' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `load' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `load' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:286:in `block in load' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:258:in `load_dependency' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:286:in `load' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:233:in `load_schema' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:255:in `block in load_schema_current' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:304:in `block in each_current_configuration' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:303:in `each' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:303:in `each_current_configuration' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:254:in `load_schema_current' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/railties/databases.rake:248:in `block (3 levels) in <main>' /home/broisatse/.rvm/gems/ruby-2.4.1@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>' 

Below is bit of the schema without schema_plus_pg_indexes (first table — backtrace points to this create_table call):

 create_table "acquired_certifications", id: :serial, force: :cascade do |t| t.date "date" t.date "expires" t.datetime "created_at" t.datetime "updated_at" t.integer "contractor_id" t.integer "certification_id" t.string "reference" t.index ["certification_id"], name: "index_acquired_certifications_on_certification_id" t.index ["contractor_id"], name: "index_acquired_certifications_on_contractor_id" end 
 create_table "acquired_certifications", id: :serial, default: %q{nextval('acquired_certifications_id_seq'::regclass)}, force: :cascade do |t| t.date "date" t.date "expires" t.datetime "created_at" t.datetime "updated_at" t.integer "contractor_id", :index=>{:name=>"index_acquired_certifications_on_contractor_id"} t.integer "certification_id", :index=>{:name=>"index_acquired_certifications_on_certification_id"} t.string "reference" end 

I am having some issues with serial type lately. Problem reflects in some changes in the schema file that cannot be loaded later on, failing wiht exception:

PG::UndefinedObject: ERROR: type "serial" does not exist LINE 1: SELECT 'serial'::regtype::oid ^ /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:61:in `async_exec' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:61:in `block (2 levels) in query' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies/interlock.rb:46:in `block in permit_concurrent_loads' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/concurrency/share_lock.rb:185:in `yield_shares' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies/interlock.rb:45:in `permit_concurrent_loads' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:60:in `block in query' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:612:in `block (2 levels) in log' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:611:in `block in log' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/notifications/instrumenter.rb:21:in `instrument' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:603:in `log' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:59:in `query' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:70:in `query_value' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/quoting.rb:81:in `lookup_cast_type' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/quoting.rb:114:in `quote_default_expression' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/quoting.rb:71:in `quote_default_expression' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:17:in `quote_default_expression' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:103:in `add_column_options!' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:42:in `block in add_column_options!' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:41:in `add_column_options!' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/schema_creation.rb:10:in `add_column_options!' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:34:in `visit_ColumnDefinition' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:14:in `accept' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:45:in `block in visit_TableDefinition' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:45:in `map' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:45:in `visit_TableDefinition' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:48:in `block in visit_TableDefinition' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:47:in `visit_TableDefinition' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:14:in `accept' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:288:in `create_table' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:28:in `block in create_table' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:27:in `create_table' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:849:in `block in method_missing' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:818:in `block in say_with_time' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:818:in `say_with_time' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:838:in `method_missing' /home/broisatse/work/Hubbado/hubbadoproto/db/schema.rb:20:in `block in <main>' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/schema.rb:48:in `instance_eval' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/schema.rb:48:in `define' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/schema.rb:44:in `define' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/schema.rb:7:in `block in define' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/schema.rb:6:in `define' /home/broisatse/work/Hubbado/hubbadoproto/db/schema.rb:13:in `<main>' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `load' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `load' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:286:in `block in load' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:258:in `load_dependency' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:286:in `load' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:233:in `load_schema' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:255:in `block in load_schema_current' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:304:in `block in each_current_configuration' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:303:in `each' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:303:in `each_current_configuration' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:254:in `load_schema_current' /home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/railties/databases.rake:248:in `block (3 levels) in <main>' /home/broisatse/.rvm/gems/ruby-2.4.1@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>' 

Below is bit of the schema without schema_plus_pg_indexes (first table — backtrace points to this create_table call):

 create_table "acquired_certifications", id: :serial, force: :cascade do |t| t.date "date" t.date "expires" t.datetime "created_at" t.datetime "updated_at" t.integer "contractor_id" t.integer "certification_id" t.string "reference" t.index ["certification_id"], name: "index_acquired_certifications_on_certification_id" t.index ["contractor_id"], name: "index_acquired_certifications_on_contractor_id" end 
 create_table "acquired_certifications", id: :serial, default: %q{nextval('acquired_certifications_id_seq'::regclass)}, force: :cascade do |t| t.date "date" t.date "expires" t.datetime "created_at" t.datetime "updated_at" t.integer "contractor_id", :index=>{:name=>"index_acquired_certifications_on_contractor_id"} t.integer "certification_id", :index=>{:name=>"index_acquired_certifications_on_certification_id"} t.string "reference" end 

Issue Description

I getting error type "serial" does not exist

What are you doing?

// postgres.js
const sql = new Sequelize(db, username, password, {
  host,
  port,
  dialect: 'postgres',
  dialectOptions: {
    ssl: false
  },
  logging: false,

  define: {
    timestamps: false,
    charset: 'utf8'
  }
});

sql
  .sync({ alter: true })
  .catch((err) =>
    logger.error(
      `[PostgreSQL]: Unable to the sync tables from server;
      ${err.message}
      ${err.parent && err.parent.sql ? '; with these SQL Query' : ''}
      ${err.parent && err.parent.sql ? 'n' : ''}
      ${(err.parent && err.parent.sql) || ''}`
    )
  )
  .then(() => sql.authenticate())
  .then(() =>
    logger.info('[PostgreSQL]: Connection has been established successfully.')
  )
  .catch((err) =>
    logger.error(
      `[PostgreSQL]: Unable to connect to the database
      ${err.message}`
    )
  );

export default sql;

// the file error happening
import DataTypes from 'sequelize';
import { v4 as uuidv4 } from 'uuid';
import sequelize from '../connections/postgres.js';

export default sequelize.define(
  'Order',
  {
    id: {
      type: DataTypes.UUID,
      defaultValue() {
        return uuidv4();
      },
      primaryKey: true
    },
    seqNo: {
      type: DataTypes.INTEGER,
      autoIncrement: true
    },
    description: {
      type: DataTypes.STRING,
      allowNull: false
    }
  },
  {
    freezeTableName: true,
    // define the table's name
    tableName: 'orders'
  }
);

What do you expect to happen?

Successfully sync, altering table

What is actually happening?

[PostgreSQL]: Unable to the sync tables from server;
      type "serial" does not exist
      ; with these SQL Query
      

      ALTER TABLE "orders" ALTER COLUMN "seqNo" DROP NOT NULL;ALTER TABLE "orders" ALTER COLUMN "seqNo" DROP DEFAULT;ALTER TABLE "orders" ALTER COLUMN "seqNo" TYPE  SERIAL;
[PostgreSQL]: Connection has been established successfully.

Additional context

Add any other context or screenshots about the feature request here.

Environment

  • Sequelize version: v6.5.0
  • Node.js version: v15.13.0
  • Operating System: macOS Catalina 10.15.7
  • If TypeScript related: TypeScript version: XXX

Issue Template Checklist

How does this problem relate to dialects?

  • I think this problem happens regardless of the dialect.
  • I think this problem happens only for the following dialect(s):
  • I don’t know, I was using Postgres, with pg@8.5.1 and pg-hstore@2.x versions and database version postgres@12

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don’t know how to start, I would need guidance.
  • No, I don’t have the time, although I believe I could do it if I had the time…
  • No, I don’t have the time and I wouldn’t even know how to start.

Есть таблица с заполненными данными:

CREATE TABLE "Виплата"
(
  old integer NOT NULL,
  "Код_договору" integer,
  "Дата" timestamp(0) without time zone,
  "Сума_виплат" text,
  "Оплата" boolean,
  "Код" integer,
  CONSTRAINT "Виплата_pkey" PRIMARY KEY (old)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE "Виплата"
  OWNER TO postgres;

Обязательно нужно изменить тип колонки «Код» на serial! Обычным

ALTER: ALTER TABLE "Виплата" ALTER COLUMN "Код" type serial;

не получается это сделать, потому что serial не тип ERROR: type "serial" does not exist ! Но сделать это очень нужно.

Каким способом можно это реализовать ?

I am having some issues with serial type lately. Problem reflects in some changes in the schema file that cannot be loaded later on, failing wiht exception:

PG::UndefinedObject: ERROR:  type "serial" does not exist
LINE 1: SELECT 'serial'::regtype::oid
               ^
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:61:in `async_exec'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:61:in `block (2 levels) in query'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies/interlock.rb:46:in `block in permit_concurrent_loads'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/concurrency/share_lock.rb:185:in `yield_shares'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies/interlock.rb:45:in `permit_concurrent_loads'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:60:in `block in query'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:612:in `block (2 levels) in log'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:611:in `block in log'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:603:in `log'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:59:in `query'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:70:in `query_value'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/quoting.rb:81:in `lookup_cast_type'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/quoting.rb:114:in `quote_default_expression'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/quoting.rb:71:in `quote_default_expression'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:17:in `quote_default_expression'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:103:in `add_column_options!'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:42:in `block in add_column_options!'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:41:in `add_column_options!'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/postgresql/schema_creation.rb:10:in `add_column_options!'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:34:in `visit_ColumnDefinition'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:14:in `accept'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:45:in `block in visit_TableDefinition'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:45:in `map'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:45:in `visit_TableDefinition'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:48:in `block in visit_TableDefinition'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:47:in `visit_TableDefinition'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_creation.rb:14:in `accept'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:288:in `create_table'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:28:in `block in create_table'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb:27:in `create_table'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:849:in `block in method_missing'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:818:in `block in say_with_time'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:818:in `say_with_time'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/migration.rb:838:in `method_missing'
/home/broisatse/work/Hubbado/hubbadoproto/db/schema.rb:20:in `block in <main>'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/schema.rb:48:in `instance_eval'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/schema.rb:48:in `define'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/schema.rb:44:in `define'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/schema.rb:7:in `block in define'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:54:in `call_implementation'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:84:in `_modware_continue'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:76:in `_modware_call'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:43:in `execute'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/modware-0.1.3/lib/modware/stack.rb:19:in `start'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_monkey-2.1.5/lib/schema_monkey/stack.rb:34:in `start'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/schema_plus_core-2.1.1/lib/schema_plus/core/active_record/schema.rb:6:in `define'
/home/broisatse/work/Hubbado/hubbadoproto/db/schema.rb:13:in `<main>'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `load'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `load'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:286:in `block in load'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:258:in `load_dependency'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:286:in `load'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:233:in `load_schema'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:255:in `block in load_schema_current'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:304:in `block in each_current_configuration'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:303:in `each'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:303:in `each_current_configuration'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/tasks/database_tasks.rb:254:in `load_schema_current'
/home/broisatse/.rvm/gems/ruby-2.4.1/gems/activerecord-5.1.3/lib/active_record/railties/databases.rake:248:in `block (3 levels) in <main>'
/home/broisatse/.rvm/gems/ruby-2.4.1@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'

Below is bit of the schema without schema_plus_pg_indexes (first table — backtrace points to this create_table call):

  create_table "acquired_certifications", id: :serial, force: :cascade do |t|
    t.date "date"
    t.date "expires"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer "contractor_id"
    t.integer "certification_id"
    t.string "reference"
    t.index ["certification_id"], name: "index_acquired_certifications_on_certification_id"
    t.index ["contractor_id"], name: "index_acquired_certifications_on_contractor_id"
  end
  create_table "acquired_certifications", id: :serial, default: %q{nextval('acquired_certifications_id_seq'::regclass)}, force: :cascade do |t|
    t.date     "date"
    t.date     "expires"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "contractor_id",    :index=>{:name=>"index_acquired_certifications_on_contractor_id"}
    t.integer  "certification_id", :index=>{:name=>"index_acquired_certifications_on_certification_id"}
    t.string   "reference"
  end

  • Ошибка тинькофф неуспешная авторизация
  • Ошибка тинькофф недостаточно данных для совершения платежа
  • Ошибка тик ток вы слишком часто пользуетесь нашими услугами
  • Ошибка тигуан восклицательный знак
  • Ошибка техобслуживания canon lbp 6020