Table Partition Switch Problem SQL Server
You've created partitioned indexes but haven't partitioned the underlying table by creating a partitioned clustered index. 

Note that the partitioning column must be part of the key for partitioned unique indexes. The implication here is that you need to add the id_file column to the primary key so that the partitioned table is aligned, which is a requirement in order to use SWITCH.

For partitioned non-unique non-clustered indexes, the partitioning column doesn't need to be part of the key. It will be implicitly included as the row locator in the index leaf nodes, just like a clustered index key.