Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
Heroku postgres unique constraint error

I have a local sqlite db that was created using the knex library. It runs perfectly fine on my local machine.

I deployed the same knex syntax on heroku but under postgres however I get the error:

error: alter table "dAppTable" add constraint 
"dapptable_dappname_unique" unique ("dAppName") - column "dAppName" 
named in key does not exist

This is unusual as the table is clearly stated below:

exports.up = function(knex, Promise)
{
  console.log('create dApp table');

  return knex.schema.createTableIfNotExists('dAppTable', function(table)
  {
    table.increments('id');
    table.string('dAppName').unique();
    table.string('abi');
    table.string('contractAddress').unique();
  })
};

exports.down = function(knex, Promise)
{
    return knex.schema.dropTableIfExists('dAppTable').then(function ()
    {
        console.log('dAppTable table was dropped');
    })
};

Here is the connection config file, production is used:

production: {
    client: 'postgresql',
    connection: process.env.DATABASE_URL,
    pool: {
        min: 2,
        max: 10
    },
    migrations: {
        tableName: 'dAppTable',
        directory: __dirname + '/migrations'
    },
    seeds: {
        directory: __dirname + '/seeds'
    }
}
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda