Skip to content

Removing or changing a primary_key table annotation breaks module updating #3934

@egormanga

Description

@egormanga
  1. Upload a module (from default template):
    #[table(name=person)]
    pub struct Person {
    	#[primary_key]
    	name: String,
    }
  2. Remove the #[primary_key] column annotation and upload again (successfully):
    Removed index person_name_idx_btree on [name] of table person
    ▸ Removed unique constraint person_name_key on [name] of table person
  3. Change absolutely anything in the module (incl. in a reducer body) and upload.

Result:

Publishing module...
Error: Failed to create or update the database: Primary key mismatch: expected self.primary_key == def.primary_key:
   self.primary_key: Some(ColId(0))
   def.primary_key: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions